summaryrefslogtreecommitdiff
path: root/server/src/commands/owner/Username.ts
blob: df6d6c486bbf847c76fba6ce877dac22e45c45c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Command } from 'discord-akairo';
import { Message } from 'discord.js';

export default class UsernameOwner extends Command {
    public constructor() {
        super('username', {
            aliases: ['username'],
            category: 'owner',
            description: {
                content: 'Change the username of the bot.',
                usage: '[username]',
                examples: [
                    'Aki'
                ]
            },
            ratelimit: 3,
            args: [
                {
                    id: 'username',
                    type: 'string',
                    prompt: {
                        start: 'What username would you like to give me?',
                    },
                    match: 'rest'
                }
            ],
            ownerOnly: true
        });
    }
    
    public exec(msg: Message, { username }): Promise<Message> {
        this.client.user.setUsername(username);
        return msg.channel.send(`My username has now been set to ${username}!`)
    }
}