mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-15 17:43:09 -04:00
support slash commands for (some) useful features
This commit is contained in:
parent
fb55cbc67d
commit
25519241ae
5 changed files with 411 additions and 0 deletions
34
commands/interaction/slash/info/avatar.js
Normal file
34
commands/interaction/slash/info/avatar.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
const { Constants } = require('detritus-client');
|
||||
const { InteractionCallbackTypes, ApplicationCommandOptionTypes } = Constants;
|
||||
|
||||
const { createEmbed } = require('../../../../labscore/utils/embed');
|
||||
|
||||
const { editOrReply } = require('../../../../labscore/utils/message');
|
||||
|
||||
module.exports = {
|
||||
description: 'Get someones avatar.',
|
||||
name: 'avatar',
|
||||
options: [
|
||||
{
|
||||
name: 'user',
|
||||
description: 'User to get the avatar from.',
|
||||
type: ApplicationCommandOptionTypes.USER,
|
||||
required: false
|
||||
}
|
||||
],
|
||||
run: async (context, args) => {
|
||||
await context.respond({data: {}, type: InteractionCallbackTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE})
|
||||
|
||||
if(!args.user) return editOrReply(context, createEmbed("default", context, {
|
||||
image: {
|
||||
url: context.user.avatarUrl + '?size=4096'
|
||||
}
|
||||
}))
|
||||
|
||||
return editOrReply(context, createEmbed("default", context, {
|
||||
image: {
|
||||
url: args.user.avatarUrl + '?size=4096'
|
||||
}
|
||||
}))
|
||||
},
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue