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/bb.js | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 src/commands/bb.js (limited to 'src/commands/bb.js') diff --git a/src/commands/bb.js b/src/commands/bb.js deleted file mode 100644 index bfd0c3a..0000000 --- a/src/commands/bb.js +++ /dev/null @@ -1,28 +0,0 @@ -const axios = require('axios').default; -const { MessageEmbed } = require('discord.js'); -const instance = axios.create({ - baseURL: 'https://breaking-bad-quotes.herokuapp.com/v1' -}); - -async function getRandomQuotes(message, args) { - const randomQuotesUrl = "/quotes"; - try { - const result = await instance.get(randomQuotesUrl); - const { quote, author } = result.data[0]; - const randomQuoteMessage = new MessageEmbed() - .setDescription(quote) - .setFooter(`${author}`); - message.channel.send(randomQuoteMessage); - } catch (error) { - const errorMessage = new MessageEmbed() - .setTitle("Stay out of territory: Error getting quotes from Walter White") - .setColor("RED"); - message.channel.send(errorMessage); - } -} - -module.exports = { - execute(client, message, args) { - getRandomQuotes(message, args); - } -} \ No newline at end of file -- cgit v1.2.3