diff --git a/commands/random/today.js b/commands/random/today.js index 57eca714..476c039a 100644 --- a/commands/random/today.js +++ b/commands/random/today.js @@ -23,8 +23,7 @@ module.exports = class TodayCommand extends Command { } try { const response = await snekfetch - .get('http://history.muffinlabs.com/date') - .buffer(); + .get('http://history.muffinlabs.com/date'); const parsedResponse = JSON.parse(response.text); const events = parsedResponse.data.Events; const randomNumber = Math.floor(Math.random() * events.length); diff --git a/commands/search/forecast.js b/commands/search/forecast.js index 8a07c181..ce7ea69a 100644 --- a/commands/search/forecast.js +++ b/commands/search/forecast.js @@ -26,7 +26,7 @@ module.exports = class ForecastCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const location = encodeURIComponent(args.locationQ); + const location = args.locationQ; try { const response = await snekfetch .get(`https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where u=\'f\' AND woeid in (select woeid from geo.places(1) where text="${location}")&format=json`); diff --git a/commands/search/weather.js b/commands/search/weather.js index fb81ebc0..aba794fd 100644 --- a/commands/search/weather.js +++ b/commands/search/weather.js @@ -23,7 +23,7 @@ module.exports = class WeatherCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const location = encodeURIComponent(args.locationQ); + const location = args.locationQ; try { const response = await snekfetch .get(`https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where u=\'f\' AND woeid in (select woeid from geo.places(1) where text="${location}")&format=json`); diff --git a/commands/search/wikipedia.js b/commands/search/wikipedia.js index 27182062..9a9c86e3 100644 --- a/commands/search/wikipedia.js +++ b/commands/search/wikipedia.js @@ -23,7 +23,8 @@ module.exports = class WikipediaCommand extends Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const query = encodeURIComponent(args.query.replace(/[)]/g, '%29')); + let query = encodeURIComponent(args.query); + query = query.replace(/[)]/g, '%29'); try { const response = await snekfetch .get(`https://en.wikipedia.org/w/api.php?action=query&prop=extracts&format=json&titles=${query}&exintro=&explaintext=&redirects=&formatversion=2`);