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/dark.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/dark.js')
-rw-r--r-- | src/commands/dark.js | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/commands/dark.js b/src/commands/dark.js deleted file mode 100644 index 54a486d..0000000 --- a/src/commands/dark.js +++ /dev/null @@ -1,29 +0,0 @@ -const axios = require('axios').default; -const { MessageEmbed } = require('discord.js'); -const instance = axios.create({ - baseURL: 'https://dark-api.herokuapp.com/api/v1' -}); - -async function getRandomQuotes(message, args) { - const randomQuotesUrl = "/quote/random"; - try { - const result = await instance.get(randomQuotesUrl); - const { author, season, episode, quote } = result.data; - const randomQuoteMessage = new MessageEmbed() - .setDescription(quote) - .setFooter(`${author}, S${season} : Episode - ${episode}`); - message.channel.send(randomQuoteMessage); - } catch (error) { - const errorMessage = new MessageEmbed() - .setTitle("Something went wrong: Error getting quotes from Mikkel Nielsen") - .setColor("RED"); - message.channel.send(errorMessage); - } -} - -module.exports = { - execute(client, message, args) { - getRandomQuotes(message, args); - } -} - |