summaryrefslogtreecommitdiff
path: root/commands/utility/btcchange.js
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-11 06:22:53 -0700
committer8cy <[email protected]>2020-04-11 06:22:53 -0700
commita80abc36f8a610cc97bd99479a6bbf55782be579 (patch)
tree3ff59dab029435584bc25b8f48978528c955f746 /commands/utility/btcchange.js
parentreworks, v2.0.5 (diff)
downloads5nical-a80abc36f8a610cc97bd99479a6bbf55782be579.tar.xz
s5nical-a80abc36f8a610cc97bd99479a6bbf55782be579.zip
big portage, v2.1.0
- remove some commenting in app.js - add gay, respect, btc, btcchange - port itemshop, psycho and abee to new play system - bolden important things in message responses
Diffstat (limited to 'commands/utility/btcchange.js')
-rw-r--r--commands/utility/btcchange.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/commands/utility/btcchange.js b/commands/utility/btcchange.js
new file mode 100644
index 0000000..3abcf7b
--- /dev/null
+++ b/commands/utility/btcchange.js
@@ -0,0 +1,39 @@
+const { Command } = require('discord.js-commando');
+const btc = require('btc-value');
+btc.setApiKey('a43419ce-fc59-4951-8af9-20c5e36ef73f');
+
+module.exports = class BTCChangeUtility extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'btcchange',
+ aliases: ['bitcoinchange', 'cryptochange', 'btcc'],
+ group: 'utility',
+ memberName: 'btcchange',
+ description: 'always you to check the fluctuation in bitcoin prices in a specified amount of time',
+ args: [
+ {
+ key: 'timeAmount',
+ prompt: 'what time range do you want to check the fluction amount in? (day, hour, week)',
+ type: 'string'
+ }
+ ]
+ });
+ }
+ run(msg, { timeAmount }) {
+ if (timeAmount == 'day') {
+ btc.getPercentageChangeLastDay().then(percentage => {
+ msg.reply('the fluction amount of *bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**');
+ });
+ } else if (timeAmount == 'hour') {
+ btc.getPercentageChangeLastHour().then(percentage => {
+ msg.reply('the fluction amount of *bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**');
+ });
+ } else if (timeAmount == 'week') {
+ btc.getPercentageChangeLastWeek().then(percentage => {
+ msg.reply('the fluction amount of *bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**');
+ });
+ } else {
+ msg.reply('*' + timeAmount + '* is not a valid range lol');
+ }
+ }
+}; \ No newline at end of file