mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 06:45:31 +02:00
Permississsions
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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']
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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}` }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user