summaryrefslogtreecommitdiff
path: root/server/src/commands/owner/IP.ts
blob: 244c11f72ed86dbf98f0768195f1bb49e5284ef1 (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
import { Command } from 'discord-akairo';
import { Message } from 'discord.js';
import request from 'node-superfetch';

export default class IPOwner extends Command {
    public constructor() {
        super('ip', {
            aliases: ['ip'],
            category: 'owner',
            description: {
                content: 'Gives you the bot\'s IP address.',
                usage: '',
                examples: [
                    ''
                ]
            },
            ratelimit: 3,
            ownerOnly: true
        });
    }
    
    public async exec(msg: Message): Promise<Message> {
        let { body } = await request.get('https://api.ipify.org').query({ format: 'json' });
        //@ts-ignore
        return msg.reply(`${this.client.user.username}'s IP address is **${body.ip}**. *Which script kiddie in chat asked you to send this zzz. -Sin*`);
    }
}