mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 01:57:54 +02:00
Finish removing "Oh no, an error occurred"
This commit is contained in:
@@ -22,13 +22,9 @@ module.exports = class FmlCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
try {
|
||||
const { text } = await request.get('http://www.fmylife.com/random');
|
||||
const $ = cheerio.load(text, { normalizeWhitespace: true });
|
||||
const fml = $('a.block').first().text().trim();
|
||||
return msg.say(fml);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
const { text } = await request.get('http://www.fmylife.com/random');
|
||||
const $ = cheerio.load(text, { normalizeWhitespace: true });
|
||||
const fml = $('a.block').first().text().trim();
|
||||
return msg.say(fml);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user