summaryrefslogtreecommitdiff
path: root/commands/utility/btc.js
blob: 6288c50f946f4e92b7633f936560b8e638c7f946 (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
const { Command } = require('discord.js-commando');
const btc = require('btc-value');
btc.setApiKey('a43419ce-fc59-4951-8af9-20c5e36ef73f');

module.exports = class BTCUtility extends Command {
    constructor(client) {
        super(client, {
            name: 'btc',
            aliases: ['bitcoin', 'crypto'],
            group: 'utility',
            memberName: 'btc',
            description: 'always you to check current bitcoin prices',
            args: [
                {
                    key: 'currencyName',
                    prompt: 'what currency u wanna see it in? (usd, aud, cad)',
                    type: 'string'
                }
            ],
            examples: [
                's5n!bitcoin aud',
                's5n!crypto cad',
                's5n!btc usd'
            ]
        });
    }
    run(msg, { currencyName }) {
        currencyName = currencyName.toUpperCase();
        btc({ isDecimal: true, currencyCode: currencyName }).then(value => {
            msg.reply('the current *bitcoin* price in **' + currencyName  + '** is **' + value + '**');
        });
    }
};