diff --git a/commands/search/github.js b/commands/search/github.js index d339b0ab..e395b1e0 100644 --- a/commands/search/github.js +++ b/commands/search/github.js @@ -33,7 +33,8 @@ module.exports = class GitHubCommand extends Command { async run(msg, { author, repository }) { try { const { body } = await snekfetch - .get(`https://${GITHUB_USERNAME}:${GITHUB_PASSWORD}@api.github.com/repos/${author}/${repository}`); + .get(`https://api.github.com/repos/${author}/${repository}`) + .set({ Authorization: `Basic ${Buffer.from(`${GITHUB_USERNAME}:${GITHUB_PASSWORD}`).toString('base64')}` }); const embed = new MessageEmbed() .setColor(0xFFFFFF) .setAuthor('GitHub', 'https://i.imgur.com/e4HunUm.png', 'https://github.com/') diff --git a/commands/search/my-anime-list-anime.js b/commands/search/my-anime-list-anime.js index 4485a774..4f331d64 100644 --- a/commands/search/my-anime-list-anime.js +++ b/commands/search/my-anime-list-anime.js @@ -29,8 +29,9 @@ module.exports = class MyAnimeListAnimeCommand extends Command { async run(msg, { query }) { try { const { text } = await snekfetch - .get(`https://${MAL_USERNAME}:${MAL_PASSWORD}@myanimelist.net/api/anime/search.xml`) - .query({ q: query }); + .get('https://myanimelist.net/api/anime/search.xml') + .query({ q: query }) + .set({ Authorization: `Basic ${Buffer.from(`${MAL_USERNAME}:${MAL_PASSWORD}`).toString('base64')}` }); const body = await xml(text); const data = body.anime.entry[0]; const embed = new MessageEmbed() diff --git a/commands/search/my-anime-list-manga.js b/commands/search/my-anime-list-manga.js index 0bbba2cc..2db94267 100644 --- a/commands/search/my-anime-list-manga.js +++ b/commands/search/my-anime-list-manga.js @@ -29,8 +29,9 @@ module.exports = class MyAnimeListMangaCommand extends Command { async run(msg, { query }) { try { const { text } = await snekfetch - .get(`https://${MAL_USERNAME}:${MAL_PASSWORD}@myanimelist.net/api/manga/search.xml`) - .query({ q: query }); + .get('https://myanimelist.net/api/manga/search.xml') + .query({ q: query }) + .set({ Authorization: `Basic ${Buffer.from(`${MAL_USERNAME}:${MAL_PASSWORD}`).toString('base64')}` }); const body = await xml(text); const data = body.manga.entry[0]; const embed = new MessageEmbed() diff --git a/commands/search/twitter.js b/commands/search/twitter.js index 5c7c21fd..7b51b713 100644 --- a/commands/search/twitter.js +++ b/commands/search/twitter.js @@ -61,11 +61,10 @@ module.exports = class TwitterCommand extends Command { } async fetchToken() { - const auth = Buffer.from(`${TWITTER_KEY}:${TWITTER_SECRET}`).toString('base64'); const { body } = await snekfetch .post('https://api.twitter.com/oauth2/token') .set({ - Authorization: `Basic ${auth}`, + Authorization: `Basic ${Buffer.from(`${TWITTER_KEY}:${TWITTER_SECRET}`).toString('base64')}`, 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }) .send('grant_type=client_credentials');