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/got.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/got.js')
-rw-r--r-- | src/commands/got.js | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/commands/got.js b/src/commands/got.js deleted file mode 100644 index bfb9295..0000000 --- a/src/commands/got.js +++ /dev/null @@ -1,28 +0,0 @@ -const axios = require('axios').default; -const { MessageEmbed } = require('discord.js'); -const instance = axios.create({ - baseURL: 'https://game-of-thrones-quotes.herokuapp.com/v1' -}); - -async function getRandomQuotes(message, args) { - const randomQuotesUrl = "/random"; - try { - const result = await instance.get(randomQuotesUrl); - const { sentence, character: { name, house: { name: houseName } } } = result.data; - const randomQuoteMessage = new MessageEmbed() - .setDescription(sentence) - .setFooter(`${name}, ${houseName}`); - message.channel.send(randomQuoteMessage); - } catch (error) { - const errorMessage = new MessageEmbed() - .setTitle("Something went wrong: Error getting quotes from Arya Stark") - .setColor("RED"); - message.channel.send(errorMessage); - } -} - -module.exports = { - execute(client, message, args) { - getRandomQuotes(message, args); - } -}
\ No newline at end of file |