mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Bug Fixes
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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`);
|
||||
|
||||
@@ -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`);
|
||||
|
||||
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user