mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 06:03:04 -04:00
add banner ctx command
This commit is contained in:
parent
8937b5d10c
commit
93a95a0523
4 changed files with 36 additions and 4 deletions
|
@ -5,7 +5,7 @@ const { createEmbed } = require('../../../labscore/utils/embed');
|
|||
const { editOrReply } = require('../../../labscore/utils/message');
|
||||
|
||||
module.exports = {
|
||||
name: 'Get User Avatar',
|
||||
name: 'View User Avatar',
|
||||
type: ApplicationCommandTypes.USER,
|
||||
contexts: [
|
||||
0,
|
||||
|
|
34
commands/interaction/user/banner.js
Normal file
34
commands/interaction/user/banner.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
const { Constants } = require('detritus-client');
|
||||
const { InteractionCallbackTypes, ApplicationCommandTypes } = Constants;
|
||||
|
||||
const { createEmbed } = require('../../../labscore/utils/embed');
|
||||
const { editOrReply } = require('../../../labscore/utils/message');
|
||||
|
||||
module.exports = {
|
||||
name: 'View User Banner',
|
||||
type: ApplicationCommandTypes.USER,
|
||||
contexts: [
|
||||
0,
|
||||
1,
|
||||
2
|
||||
],
|
||||
integrationTypes: [
|
||||
1
|
||||
],
|
||||
run: async (context, args) => {
|
||||
try{
|
||||
await context.respond({ data: {}, type: InteractionCallbackTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE })
|
||||
|
||||
let u = await context.client.rest.fetchUser(args.user.id);
|
||||
if(!u.bannerUrl) return editOrReply(context, createEmbed("warning", context, "User doesn't have a banner set."));
|
||||
|
||||
return editOrReply(context, createEmbed("default", context, {
|
||||
image: {
|
||||
url: u.bannerUrl + '?size=4096'
|
||||
}
|
||||
}))
|
||||
}catch(e){
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
};
|
|
@ -25,7 +25,7 @@ module.exports = {
|
|||
|
||||
const { user, member } = args;
|
||||
|
||||
let u = user;
|
||||
let u = await context.client.rest.fetchUser(user.id);;
|
||||
let m = member;
|
||||
|
||||
let botTag = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue