mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 08:12:04 +02:00
Red Panda Command
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class RedPandaCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'red-panda',
|
||||
aliases: ['r-panda'],
|
||||
group: 'random-img',
|
||||
memberName: 'red-panda',
|
||||
description: 'Responds with a random red panda image.',
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
credit: [
|
||||
{
|
||||
name: 'redpanda.pics',
|
||||
url: 'https://redpanda.pics/',
|
||||
reason: 'API',
|
||||
reasonURL: 'https://github.com/NexInfinite/redpandapics'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
try {
|
||||
const { body } = await request.get('https://redpanda.pics/random');
|
||||
return msg.say({ files: [body.url] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "135.4.0",
|
||||
"version": "135.5.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"private": true,
|
||||
|
||||
Reference in New Issue
Block a user