From 2ad459a0910498f39c8c5abd697189b788df827a Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 5 May 2017 18:03:46 +0200 Subject: add crunch request command for beta test --- commands/vainsocial/guild_fame_calc.js | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 commands/vainsocial/guild_fame_calc.js 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."); + } +}; -- cgit v1.3.1