Permississsions

This commit is contained in:
Daniel Odendahl Jr
2017-10-11 20:52:24 +00:00
parent a0261c1f03
commit 04c1728591
5 changed files with 15 additions and 7 deletions
+2 -1
View File
@@ -10,7 +10,8 @@ module.exports = class AkinatorCommand extends Command {
aliases: ['the-web-genie', 'web-genie'],
group: 'games',
memberName: 'akinator',
description: 'Play a game of Akinator!'
description: 'Play a game of Akinator!',
clientPermissions: ['EMBED_LINKS']
});
this.sessions = new Map();
+2 -1
View File
@@ -9,7 +9,8 @@ module.exports = class WhosThatPokemonCommand extends Command {
aliases: ['who-pokemon', 'whos-that-pokémon', 'who-pokémon'],
group: 'games',
memberName: 'whos-that-pokemon',
description: 'Guess who that Pokémon is.'
description: 'Guess who that Pokémon is.',
clientPermissions: ['ATTACH_FILES']
});
}
+9 -5
View File
@@ -1,4 +1,5 @@
const { Command } = require('discord.js-commando');
const snekfetch = require('snekfetch');
module.exports = class AvatarCommand extends Command {
constructor(client) {
@@ -7,7 +8,8 @@ module.exports = class AvatarCommand extends Command {
aliases: ['profile-picture', 'profile-pic'],
group: 'other',
memberName: 'avatar',
description: 'Responds with a link to a user\'s avatar.',
description: 'Responds with a user\'s avatar.',
clientPermissions: ['ATTACH_FILES'],
args: [
{
key: 'user',
@@ -19,13 +21,15 @@ module.exports = class AvatarCommand extends Command {
});
}
run(msg, { user }) {
async run(msg, { user }) {
if (!user) user = msg.author;
if (!user.avatar) return msg.say('This user has no avatar.');
const avatar = user.avatarURL({
format: user.avatar.startsWith('a_') ? 'gif' : 'png',
const format = user.avatar.startsWith('a_') ? 'gif' : 'png';
const avatarURL = user.avatarURL({
format,
size: 2048
});
return msg.say(avatar);
const { body } = await snekfetch.get(avatarURL);
return msg.say({ files: [{ attachment: body, name: `avatar.${format}` }] });
}
};
+1
View File
@@ -11,6 +11,7 @@ module.exports = class StocksCommand extends Command {
group: 'search',
memberName: 'stocks',
description: 'Get the current stocks for a symbol.',
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'symbol',
+1
View File
@@ -11,6 +11,7 @@ module.exports = class VocaloidCommand extends Command {
group: 'search',
memberName: 'vocaloid',
description: 'Searches VocaDB for your query.',
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'query',