summaryrefslogtreecommitdiff
path: root/commands/utility/btc.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands/utility/btc.js')
-rw-r--r--commands/utility/btc.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/commands/utility/btc.js b/commands/utility/btc.js
new file mode 100644
index 0000000..caf4e22
--- /dev/null
+++ b/commands/utility/btc.js
@@ -0,0 +1,28 @@
+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'
+ }
+ ]
+ });
+ }
+ run(msg, { currencyName }) {
+ currencyName = currencyName.toUpperCase();
+ btc({ isDecimal: true, currencyCode: currencyName }).then(value => {
+ msg.reply('the current *bitcoin* price in **' + currencyName + '** is **' + value + '**');
+ });
+ }
+}; \ No newline at end of file