diff options
author | Indrajith K L | 2021-06-19 18:30:58 +0530 |
---|---|---|
committer | Indrajith K L | 2021-06-19 18:30:58 +0530 |
commit | 0ef3c83f4049227c08731e3f31e53c38e1da5957 (patch) | |
tree | 349b423111db5a8730864b8c555bb15564622377 /src/commands/jokes.js | |
parent | caebd6b3e5315d3002107464b33ae7b6bf006800 (diff) | |
download | radio-bot-0ef3c83f4049227c08731e3f31e53c38e1da5957.tar.gz radio-bot-0ef3c83f4049227c08731e3f31e53c38e1da5957.tar.bz2 radio-bot-0ef3c83f4049227c08731e3f31e53c38e1da5957.zip |
* Radio Bot Implementation
Diffstat (limited to 'src/commands/jokes.js')
-rw-r--r-- | src/commands/jokes.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/commands/jokes.js b/src/commands/jokes.js deleted file mode 100644 index 578e51b..0000000 --- a/src/commands/jokes.js +++ /dev/null @@ -1,28 +0,0 @@ -const fetch = require('node-fetch'); - -function randomJokes(message) { - message.channel.startTyping(); - getJokes().then(response => { - message.channel.stopTyping(); - if (response) { - message.channel.startTyping(); - message.reply(response.setup); - setTimeout(() => { - message.channel.stopTyping(); - message.reply(`||${response.punchline}||`); - }, 5000); - } - }); -} - -async function getJokes() { - return fetch(`https://official-joke-api.appspot.com/jokes/random`) - .then(res => res.json()) -} - - -module.exports = { - execute(client,message, args) { - randomJokes(message); - } -}
\ No newline at end of file |