diff --git a/commands/random-img/red-panda.js b/commands/random-img/red-panda.js new file mode 100644 index 00000000..1950a0ae --- /dev/null +++ b/commands/random-img/red-panda.js @@ -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!`); + } + } +}; diff --git a/package.json b/package.json index da239e6f..4131d899 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "135.4.0", + "version": "135.5.0", "description": "Your personal server companion.", "main": "Xiao.js", "private": true,