mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add command for owner to set banner
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user