diff --git a/commands/random-img/goose.js b/commands/random-img/goose.js new file mode 100644 index 00000000..faa2986f --- /dev/null +++ b/commands/random-img/goose.js @@ -0,0 +1,31 @@ +const Command = require('../../structures/Command'); +const request = require('node-superfetch'); + +module.exports = class GooseCommand extends Command { + constructor(client) { + super(client, { + name: 'goose', + aliases: ['geese'], + group: 'random-img', + memberName: 'goose', + description: 'Responds with a random goose image.', + clientPermissions: ['ATTACH_FILES'], + credit: [ + { + name: 'nekos.life', + url: 'https://nekos.life/', + reason: 'API' + } + ] + }); + } + + async run(msg) { + try { + const { body } = await request.get('https://nekos.life/api/v2/img/goose'); + return msg.say({ files: [body.url] }); + } catch (err) { + return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; diff --git a/commands/random-img/lizard.js b/commands/random-img/lizard.js new file mode 100644 index 00000000..86a5d8c5 --- /dev/null +++ b/commands/random-img/lizard.js @@ -0,0 +1,30 @@ +const Command = require('../../structures/Command'); +const request = require('node-superfetch'); + +module.exports = class LizardCommand extends Command { + constructor(client) { + super(client, { + name: 'lizard', + group: 'random-img', + memberName: 'lizard', + description: 'Responds with a random lizard image.', + clientPermissions: ['ATTACH_FILES'], + credit: [ + { + name: 'nekos.life', + url: 'https://nekos.life/', + reason: 'API' + } + ] + }); + } + + async run(msg) { + try { + const { body } = await request.get('https://nekos.life/api/v2/img/lizard'); + 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 076b6b07..682b7be7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "135.1.0", + "version": "135.2.0", "description": "Your personal server companion.", "main": "Xiao.js", "private": true,