mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Improve cowsay
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const { stripIndent } = require('common-tags');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class CowSayCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -22,16 +22,17 @@ module.exports = class CowSayCommand extends Command {
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { text }) {
|
||||
return msg.code(null,
|
||||
stripIndent`
|
||||
< ${text} >
|
||||
\\ ^__^
|
||||
\\ (oO)\\_______
|
||||
(__)\\ )\\/\\
|
||||
U ||----w |
|
||||
|| ||
|
||||
`
|
||||
);
|
||||
async run(msg, { text }) {
|
||||
try {
|
||||
const { body } = await snekfetch
|
||||
.get('http://cowsay.morecode.org/say')
|
||||
.query({
|
||||
message: text,
|
||||
format: 'json'
|
||||
});
|
||||
return msg.code(null, body.cow);
|
||||
} catch (err) {
|
||||
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "44.4.2",
|
||||
"version": "44.4.3",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user