mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 06:37:32 +02:00
Style changes
This commit is contained in:
@@ -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!`);
|
||||
|
||||
@@ -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!`);
|
||||
|
||||
@@ -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)];
|
||||
|
||||
@@ -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.');
|
||||
|
||||
@@ -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!`);
|
||||
|
||||
Reference in New Issue
Block a user