From 0ef3c83f4049227c08731e3f31e53c38e1da5957 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 19 Jun 2021 18:30:58 +0530 Subject: * Radio Bot Implementation --- src/commands/jokes.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/commands/jokes.js (limited to 'src/commands/jokes.js') 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 -- cgit v1.2.3