diff options
| author | 8cy <[email protected]> | 2020-04-13 05:32:35 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-13 05:32:35 -0700 |
| commit | 9dff52f7d047c905326bc2f476ede5463e00f2a0 (patch) | |
| tree | 1fec8563b3b72fde9b2ab7ad9e56a97398798685 /src/commands/utility/btc.js | |
| parent | typescript (diff) | |
| download | s5nical-9dff52f7d047c905326bc2f476ede5463e00f2a0.tar.xz s5nical-9dff52f7d047c905326bc2f476ede5463e00f2a0.zip | |
typescript final
Diffstat (limited to 'src/commands/utility/btc.js')
| -rw-r--r-- | src/commands/utility/btc.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/commands/utility/btc.js b/src/commands/utility/btc.js new file mode 100644 index 0000000..3971fa9 --- /dev/null +++ b/src/commands/utility/btc.js @@ -0,0 +1,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: 'allows 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 + '** ' + emoji.random()); + }); + } +};
\ No newline at end of file |