Add discord card command

This commit is contained in:
Dragon Fire
2024-03-21 22:30:26 -04:00
parent 25a17c790b
commit 175eba1732
+31
View File
@@ -0,0 +1,31 @@
const Command = require('../../framework/Command');
const request = require('node-superfetch');
module.exports = class MtgCardCommand extends Command {
constructor(client) {
super(client, {
name: 'mtg-card',
aliases: ['mtg', 'discord', 'discord-card', 'mtg-discord', 'mtg-discord-card'],
group: 'random-res',
memberName: 'github-zen',
description: 'Responds with a random castable Magic: The Gathering card for Discord, Lord of Disharmony.',
credit: [
{
name: 'Scryfall',
url: 'https://scryfall.com/',
reason: 'Random Results',
reasonURL: 'https://scryfall.com/random?q=is%3Aspell+game%3Apaper'
}
]
});
}
async run(msg) {
try {
const { url } = await request.get('https://scryfall.com/random?q=is%3Aspell+game%3Apaper');
return msg.say(url);
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};