Duck Command

This commit is contained in:
Daniel Odendahl Jr
2018-09-08 01:59:52 +00:00
parent 00816cd853
commit 20fa23c016
3 changed files with 27 additions and 2 deletions
+2 -1
View File
@@ -15,7 +15,7 @@ Xiao is a Discord bot coded in JavaScript with
The bot is no longer available for invite. You can self-host the bot, or use her
on the [home server](https://discord.gg/sbMe32W).
## Commands (302)
## Commands (303)
### Utility:
* **eval:** Executes JavaScript code.
@@ -55,6 +55,7 @@ on the [home server](https://discord.gg/sbMe32W).
* **dog-fact:** Responds with a random dog fact.
* **dog:** Responds with a random dog image.
* **draw-cards:** Draws a random hand of playing cards.
* **duck**: Responds with a random duck image.
* **fact-core:** Responds with a random Fact Core quote.
* **fact:** Responds with a random fact.
* **fidget:** Responds with a random image of Fidget.
+24
View File
@@ -0,0 +1,24 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class DuckCommand extends Command {
constructor(client) {
super(client, {
name: 'duck',
aliases: ['quack', 'ducky'],
group: 'random',
memberName: 'duck',
description: 'Responds with a random duck image.',
clientPermissions: ['ATTACH_FILES']
});
}
async run(msg) {
try {
const { body } = await request.get('https://api.random-d.uk/random');
return msg.say({ files: [body.url] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "90.4.0",
"version": "90.5.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {