Files
xiao/commands/util/upvote.js
T
Daniel Odendahl Jr 1938b65786 shorten in Util
2017-08-22 21:01:08 +00:00

28 lines
789 B
JavaScript

const Command = require('../../structures/Command');
const snekfetch = require('snekfetch');
const { stripIndents } = require('common-tags');
const { DBOTSORG_KEY } = process.env;
module.exports = class UpvoteCommand extends Command {
constructor(client) {
super(client, {
name: 'upvote',
aliases: ['upvoters', 'updoot'],
group: 'util',
memberName: 'upvote',
description: 'Responds with Xiao\'s upvoters on Discord Bots.',
guarded: true
});
}
async run(msg) {
const { body } = await snekfetch
.get(`https://discordbots.org/api/bots/${this.client.user.id}/votes`)
.set({ Authorization: DBOTSORG_KEY });
return msg.say(stripIndents`
Upvote Xiao and get rewards while joining ${body.length} others!
<https://discordbots.org/bot/xiaobot>
`);
}
};