mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 13:53:12 +02:00
Duck Command
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "90.4.0",
|
||||
"version": "90.5.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user