diff --git a/commands/games/whos-that-pokemon.js b/commands/games/whos-that-pokemon.js index 50ad9b83..74ef93b2 100644 --- a/commands/games/whos-that-pokemon.js +++ b/commands/games/whos-that-pokemon.js @@ -18,8 +18,7 @@ module.exports = class WhosThatPokemonCommand extends Command { async run(msg) { const pokemon = Math.floor(Math.random() * 721) + 1; try { - const { body } = await snekfetch - .get(`https://pokeapi.co/api/v2/pokemon-species/${pokemon}/`); + const { body } = await snekfetch.get(`https://pokeapi.co/api/v2/pokemon-species/${pokemon}/`); const names = body.names.map(name => name.name.toLowerCase()); const displayName = filterPkmn(body.names).name; const id = `${'000'.slice(body.id.toString().length)}${body.id}`; diff --git a/commands/image-edit/meme.js b/commands/image-edit/meme.js index 5bd2f013..00ac7a60 100644 --- a/commands/image-edit/meme.js +++ b/commands/image-edit/meme.js @@ -44,8 +44,7 @@ module.exports = class MemeCommand extends Command { async run(msg, { type, top, bottom }) { try { - const memes = await snekfetch - .get('https://api.imgflip.com/get_memes'); + const memes = await snekfetch.get('https://api.imgflip.com/get_memes'); const memeList = memes.body.data.memes; if (type === 'list') return msg.say(list(memeList.map(meme => meme.name), 'or'), { split: { char: ' ' } }); if (!memeList.some(meme => meme.name.toLowerCase() === type)) { diff --git a/commands/image-edit/robohash.js b/commands/image-edit/robohash.js index 121dfe93..48e11ce6 100644 --- a/commands/image-edit/robohash.js +++ b/commands/image-edit/robohash.js @@ -22,8 +22,7 @@ module.exports = class RobohashCommand extends Command { async run(msg, { text }) { try { - const { body } = await snekfetch - .get(`https://robohash.org/${text}`); + const { body } = await snekfetch.get(`https://robohash.org/${text}`); return msg.say({ files: [{ attachment: body, name: 'robohash.png' }] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); diff --git a/commands/other/horoscope.js b/commands/other/horoscope.js index 11040ae7..b3e7e498 100644 --- a/commands/other/horoscope.js +++ b/commands/other/horoscope.js @@ -30,8 +30,7 @@ module.exports = class HoroscopeCommand extends Command { async run(msg, { sign }) { try { - const { text } = await snekfetch - .get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today/`); + const { text } = await snekfetch.get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today/`); const body = JSON.parse(text); const embed = new MessageEmbed() .setColor(0x9797FF) diff --git a/commands/other/spoopy-link.js b/commands/other/spoopy-link.js index e8d9aef7..0844d4dd 100644 --- a/commands/other/spoopy-link.js +++ b/commands/other/spoopy-link.js @@ -23,8 +23,7 @@ module.exports = class SpoopyLinkCommand extends Command { async run(msg, { site }) { if (/discord(\.gg|app\.com%2Finvite|\.me)%2F/gi.test(site)) return msg.say('Discord invites are safe!'); try { - const { body } = await snekfetch - .get(`https://spoopy.link/api/${site}`); + const { body } = await snekfetch.get(`https://spoopy.link/api/${site}`); return msg.say(stripIndents` ${body.safe ? 'This site is safe!' : 'This site may not be safe...'} ${body.chain.map(url => `<${url.url}> [${url.safe ? 'SAFE' : `UNSAFE: ${url.reasons.join(', ')}`}]`).join('\n')} diff --git a/commands/other/xkcd.js b/commands/other/xkcd.js index 79da6bd7..23007d6b 100644 --- a/commands/other/xkcd.js +++ b/commands/other/xkcd.js @@ -25,8 +25,7 @@ module.exports = class XKCDCommand extends Command { async run(msg, { type }) { try { - const current = await snekfetch - .get('https://xkcd.com/info.0.json'); + const current = await snekfetch.get('https://xkcd.com/info.0.json'); if (type === 'today') { const embed = new MessageEmbed() .setTitle(`${current.body.num} - ${current.body.title}`) @@ -38,8 +37,7 @@ module.exports = class XKCDCommand extends Command { } if (type === 'random') { const random = Math.floor(Math.random() * current.body.num) + 1; - const { body } = await snekfetch - .get(`https://xkcd.com/${random}/info.0.json`); + const { body } = await snekfetch.get(`https://xkcd.com/${random}/info.0.json`); const embed = new MessageEmbed() .setTitle(`${body.num} - ${body.title}`) .setColor(0x9797FF) @@ -50,8 +48,7 @@ module.exports = class XKCDCommand extends Command { } const choice = parseInt(type, 10); if (isNaN(choice) || current.body.num < choice || choice < 1) return msg.say('Could not find any results.'); - const { body } = await snekfetch - .get(`https://xkcd.com/${choice}/info.0.json`); + const { body } = await snekfetch.get(`https://xkcd.com/${choice}/info.0.json`); const embed = new MessageEmbed() .setTitle(`${body.num} - ${body.title}`) .setColor(0x9797FF) diff --git a/commands/random-res/cat.js b/commands/random-res/cat.js index 8d24dd36..c890059d 100644 --- a/commands/random-res/cat.js +++ b/commands/random-res/cat.js @@ -15,8 +15,7 @@ module.exports = class CatCommand extends Command { async run(msg) { try { - const { body } = await snekfetch - .get('http://random.cat/meow'); + const { body } = await snekfetch.get('http://random.cat/meow'); return msg.say({ files: [body.file] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); diff --git a/commands/random-res/dog.js b/commands/random-res/dog.js index bd9cec66..be6aca83 100644 --- a/commands/random-res/dog.js +++ b/commands/random-res/dog.js @@ -15,8 +15,7 @@ module.exports = class DogCommand extends Command { async run(msg) { try { - const { body } = await snekfetch - .get('https://dog.ceo/api/breeds/image/random'); + const { body } = await snekfetch.get('https://dog.ceo/api/breeds/image/random'); return msg.say({ files: [body.message] }); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); diff --git a/commands/random-res/history.js b/commands/random-res/history.js index 9564659a..a1152a1d 100644 --- a/commands/random-res/history.js +++ b/commands/random-res/history.js @@ -24,8 +24,7 @@ module.exports = class HistoryCommand extends Command { async run(msg, { date }) { try { - const { text } = await snekfetch - .get(`http://history.muffinlabs.com/date${date ? `/${date}` : ''}`); + const { text } = await snekfetch.get(`http://history.muffinlabs.com/date${date ? `/${date}` : ''}`); const body = JSON.parse(text); const events = body.data.Events; const event = events[Math.floor(Math.random() * events.length)]; diff --git a/commands/random-res/number-fact.js b/commands/random-res/number-fact.js index 72189d92..933ca1fc 100644 --- a/commands/random-res/number-fact.js +++ b/commands/random-res/number-fact.js @@ -20,8 +20,7 @@ module.exports = class NumberFactCommand extends Command { async run(msg, { number }) { try { - const { text } = await snekfetch - .get(`http://numbersapi.com/${number}`); + const { text } = await snekfetch.get(`http://numbersapi.com/${number}`); return msg.say(text); } catch (err) { if (err.status === 404) return msg.say('Could not find any results.'); diff --git a/commands/random-res/quote.js b/commands/random-res/quote.js index e8e4ddaa..17984bc4 100644 --- a/commands/random-res/quote.js +++ b/commands/random-res/quote.js @@ -13,8 +13,7 @@ module.exports = class QuoteCommand extends Command { async run(msg) { try { - const { body } = await snekfetch - .get('https://talaikis.com/api/quotes/random/'); + const { body } = await snekfetch.get('https://talaikis.com/api/quotes/random/'); return msg.say(`${body.quote} - _${body.author}_`); } catch (err) { return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); diff --git a/commands/search/derpibooru.js b/commands/search/derpibooru.js index 75cb416d..a13200b5 100644 --- a/commands/search/derpibooru.js +++ b/commands/search/derpibooru.js @@ -29,8 +29,7 @@ module.exports = class DerpibooruCommand extends Command { random_image: 1 }); if (!search.body) return msg.say('Could not find any results.'); - const { body } = await snekfetch - .get(`https://derpibooru.org/images/${search.body.id}.json`); + const { body } = await snekfetch.get(`https://derpibooru.org/images/${search.body.id}.json`); return msg.say(stripIndents` Result for ${query}: https:${body.representations.medium} diff --git a/commands/search/github.js b/commands/search/github.js index 3adf0ef6..c3c3ae5c 100644 --- a/commands/search/github.js +++ b/commands/search/github.js @@ -31,8 +31,7 @@ module.exports = class GitHubCommand extends Command { async run(msg, { author, repository }) { try { - const { body } = await snekfetch - .get(`https://${GITHUB_LOGIN}@api.github.com/repos/${author}/${repository}`); + const { body } = await snekfetch.get(`https://${GITHUB_LOGIN}@api.github.com/repos/${author}/${repository}`); const embed = new MessageEmbed() .setColor(0xFFFFFF) .setAuthor('GitHub', 'https://i.imgur.com/e4HunUm.png') diff --git a/commands/search/ip-info.js b/commands/search/ip-info.js index e4209c3e..263b1900 100644 --- a/commands/search/ip-info.js +++ b/commands/search/ip-info.js @@ -24,8 +24,7 @@ module.exports = class IPInfoCommand extends Command { async run(msg, { ip }) { try { - const { body } = await snekfetch - .get(`https://ipinfo.io/${ip}/json`); + const { body } = await snekfetch.get(`https://ipinfo.io/${ip}/json`); const embed = new MessageEmbed() .setColor(0x9797FF) .setURL(`https://ipinfo.io/${ip}`) diff --git a/commands/search/npm.js b/commands/search/npm.js index 573dcc47..5e2e7759 100644 --- a/commands/search/npm.js +++ b/commands/search/npm.js @@ -25,8 +25,7 @@ module.exports = class NPMCommand extends Command { async run(msg, { query }) { try { - const { body } = await snekfetch - .get(`https://registry.npmjs.com/${query}`); + const { body } = await snekfetch.get(`https://registry.npmjs.com/${query}`); const embed = new MessageEmbed() .setColor(0xCB0000) .setAuthor('NPM', 'https://i.imgur.com/ErKf5Y0.png') diff --git a/commands/search/pokedex.js b/commands/search/pokedex.js index 8c60900e..301e0ca1 100644 --- a/commands/search/pokedex.js +++ b/commands/search/pokedex.js @@ -26,8 +26,7 @@ module.exports = class PokedexCommand extends Command { async run(msg, { pokemon }) { try { - const { body } = await snekfetch - .get(`https://pokeapi.co/api/v2/pokemon-species/${pokemon}/`); + const { body } = await snekfetch.get(`https://pokeapi.co/api/v2/pokemon-species/${pokemon}/`); const id = `${'000'.slice(body.id.toString().length)}${body.id}`; const embed = new MessageEmbed() .setColor(0xED1C24) diff --git a/commands/search/rotten-tomatoes.js b/commands/search/rotten-tomatoes.js index e0de04b3..615c00c6 100644 --- a/commands/search/rotten-tomatoes.js +++ b/commands/search/rotten-tomatoes.js @@ -32,8 +32,8 @@ module.exports = class RottenTomatoesCommand extends Command { }); if (!search.body.movies.length) return msg.say('Could not find any results.'); const find = search.body.movies.find(m => m.name.toLowerCase() === query.toLowerCase()) || search.body.movies[0]; - const { text } = await snekfetch - .get(`https://www.rottentomatoes.com/api/private/v1.0/movies/${find.url.replace('/m/', '')}`); + const urlID = find.url.replace('/m/', ''); + const { text } = await snekfetch.get(`https://www.rottentomatoes.com/api/private/v1.0/movies/${urlID}`); const data = JSON.parse(text); const embed = new MessageEmbed() .setColor(0xFFEC02) diff --git a/commands/search/yu-gi-oh.js b/commands/search/yu-gi-oh.js index d7507753..04e835d0 100644 --- a/commands/search/yu-gi-oh.js +++ b/commands/search/yu-gi-oh.js @@ -24,11 +24,9 @@ module.exports = class YuGiOhCommand extends Command { async run(msg, { query }) { try { - const { body } = await snekfetch - .get(`https://yugiohprices.com/api/card_data/${query}`); + const { body } = await snekfetch.get(`https://yugiohprices.com/api/card_data/${query}`); if (body.status === 'fail') return msg.say('Could not find any results.'); - const image = await snekfetch - .get(`https://yugiohprices.com/api/card_image/${query}`, { followRedirects: false }); + const image = await snekfetch.get(`https://yugiohprices.com/api/card_image/${query}`, { followRedirects: false }); const { data } = body; const embed = new MessageEmbed() .setColor(0xBE5F1F)