diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-05 18:03:46 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-05 18:03:46 +0200 |
| commit | 2ad459a0910498f39c8c5abd697189b788df827a (patch) | |
| tree | 2680ef4860aa363f74c129945ccce0bc70767f7a | |
| parent | a5bd191b194ca97afd777a4bb523981e4855df92 (diff) | |
| download | discordbot-2ad459a0910498f39c8c5abd697189b788df827a.tar.gz discordbot-2ad459a0910498f39c8c5abd697189b788df827a.zip | |
add crunch request command for beta test
| -rw-r--r-- | commands/vainsocial/guild_fame_calc.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/commands/vainsocial/guild_fame_calc.js b/commands/vainsocial/guild_fame_calc.js new file mode 100644 index 0000000..fbd7469 --- /dev/null +++ b/commands/vainsocial/guild_fame_calc.js @@ -0,0 +1,36 @@ +#!/usr/bin/node +/* jshint esnext:true */ +"use strict"; + +const Commando = require("discord.js-commando"), + oneLine = require("common-tags").oneLine, + api = require("../../api"), + util = require("../../util"); + +module.exports = class CalculateGuildFameCommand extends Commando.Command { + constructor(client) { + super(client, { + name: "vainsocial-guildcalc", + aliases: ["vguild-calc", "vgcalc", "vgc"], + group: "vainsocial-guild", + memberName: "vainsocial-guildcalc", + description: "Update your Guild's fame.", + details: oneLine` +Recalculate your Guild members' fame. +`, + examples: ["vgcalc"] + }); + } + // internal / premium: immediately call backend fame refresh + async run(msg, args) { + util.trackAction(msg, "vainsocial-guild-calculate"); + const guild = await api.getGuild(msg.author.id); + if (guild == undefined) { + await msg.reply("You are not registered in any guilds."); + return; + } + await msg.reply("Your Guild members' fame will be updated soon…"); + await api.calculateGuild(guild.id, msg.author.id); + await msg.reply("Your Guild members' fame has been updated."); + } +}; |
