Add command for owner to set banner

This commit is contained in:
Dragon Fire
2024-04-07 17:03:57 -04:00
parent 21e4ff5f08
commit fbe2244d2f
2 changed files with 30 additions and 1 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ Just read `LICENSE.md`. Give credit if you use any part of this monster, thanks.
22. Start Xiao up!
## Commands
Total: 511
Total: 512
### Utility:
+29
View File
@@ -0,0 +1,29 @@
const Command = require('../../framework/Command');
const { DataResolver } = require('discord.js');
module.exports = class BannerCommand extends Command {
constructor(client) {
super(client, {
name: 'banner',
group: 'util',
memberName: 'banner',
description: 'Sets the bot\'s banner.',
details: 'Only the bot owner(s) may use this command.',
ownerOnly: true,
guarded: true,
args: [
{
key: 'image',
type: 'image'
}
]
});
}
async run(msg, { image }) {
await this.client.rest.patch('/users/@me', {
body: { banner: await DataResolver.resolveImage(image) }
});
return msg.say('Set the banner.');
}
};