This commit is contained in:
Daniel Odendahl Jr
2018-06-20 02:34:13 +00:00
parent 242f3dcbf5
commit 6a35acc584
3 changed files with 34 additions and 2 deletions
+2 -1
View File
@@ -15,7 +15,7 @@ You can invite the bot to your server using
Be sure to also join the [home server](https://discord.gg/sbMe32W) for
information and support.
## Commands (302)
## Commands (303)
### Utility:
* **prefix**: Shows or sets the command prefix.
@@ -136,6 +136,7 @@ information and support.
* **google**: Searches Google for your query.
* **gravatar**: Responds with the Gravatar for an email.
* **http-cat**: Responds with a cat for an HTTP status code.
* **http-dog**: Responds with a dog for an HTTP status code.
* **imgur**: Searches Imgur for your query.
* **itunes**: Searches iTunes for your query.
* **jisho**: Defines a word, but with Japanese.
+31
View File
@@ -0,0 +1,31 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class HttpDogCommand extends Command {
constructor(client) {
super(client, {
name: 'http-dog',
group: 'search',
memberName: 'http-dog',
description: 'Responds with a dog for an HTTP status code.',
clientPermissions: ['ATTACH_FILES'],
args: [
{
key: 'code',
prompt: 'What code do you want to get the dog of?',
type: 'integer'
}
]
});
}
async run(msg, { code }) {
try {
const { body, headers } = await request.get(`https://httpstatusdogs.com/img/${code}.jpg`);
if (headers['content-type'].includes('text/html')) return msg.say('Could not find any results.');
return msg.say({ files: [{ attachment: body, name: `${code}.jpg` }] });
} 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": "80.0.0",
"version": "80.1.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {