summaryrefslogtreecommitdiff
path: root/src/commands/crypto/btcchange.ts
diff options
context:
space:
mode:
author8cy <[email protected]>2020-06-27 22:52:54 -0700
committer8cy <[email protected]>2020-06-27 22:52:54 -0700
commit80951013e391aab140800e4f386867e6c391553f (patch)
tree3d7101237ef1cd8d6fe2a2fab751a2dc55ae7d84 /src/commands/crypto/btcchange.ts
parentmore config shit (diff)
downloaddep-core-80951013e391aab140800e4f386867e6c391553f.tar.xz
dep-core-80951013e391aab140800e4f386867e6c391553f.zip
add ts defs so not a lot of errors left
- made .todo file for epic error tracking
Diffstat (limited to 'src/commands/crypto/btcchange.ts')
-rw-r--r--src/commands/crypto/btcchange.ts21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/commands/crypto/btcchange.ts b/src/commands/crypto/btcchange.ts
index f0b05b0..002a2cb 100644
--- a/src/commands/crypto/btcchange.ts
+++ b/src/commands/crypto/btcchange.ts
@@ -1,10 +1,11 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
+import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
import btc from 'btc-value';
+//@ts-ignore no types
import emoji from 'emoji-random';
btc.setApiKey('a43419ce-fc59-4951-8af9-20c5e36ef73f');
module.exports = class BTCChangeCrypto extends Command {
- constructor(client) {
+ constructor(client: CommandoClient) {
super(client, {
name: 'btcchange',
aliases: ['bitcoinchange', 'cryptochange', 'btcc'],
@@ -33,21 +34,21 @@ module.exports = class BTCChangeCrypto extends Command {
clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
});
}
- run(msg: CommandoMessage, { timeAmount }) {
+ run(msg: CommandoMessage, { timeAmount }: any) {
if (timeAmount == 'day') {
- btc.getPercentageChangeLastDay().then(percentage => {
- msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random());
+ return btc.getPercentageChangeLastDay().then(percentage => {
+ return msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random());
});
} else if (timeAmount == 'hour') {
- btc.getPercentageChangeLastHour().then(percentage => {
- msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random());
+ return btc.getPercentageChangeLastHour().then(percentage => {
+ return msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random());
});
} else if (timeAmount == 'week') {
- btc.getPercentageChangeLastWeek().then(percentage => {
- msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random());
+ return btc.getPercentageChangeLastWeek().then(percentage => {
+ return msg.reply('The fluction amount of *Bitcoin* in the last **' + timeAmount + '** is **' + percentage + '%**. ' + emoji.random());
});
} else {
- msg.reply('*' + timeAmount + '* is not a valid range. ' + emoji.random());
+ return msg.reply('*' + timeAmount + '* is not a valid range. ' + emoji.random());
}
}
}; \ No newline at end of file