Add files via upload

This commit is contained in:
Terryiscool160 2020-03-11 20:52:43 +00:00 committed by GitHub
parent 76d6230e97
commit cab212cecc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 2 deletions

View file

@ -1,2 +1,10 @@
Added a yodish command and made catfact and dogfact say if the api errors (terry)
Links to avatars now lead to the original file size Links to avatars now lead to the original file size
Bots now get a bot badge in the userinfo command Bots now get a bot badge in the userinfo command
Added dogfact and catfact command (terry)
index.js now has better logging of when things fail to load/initialize (terry)
added `dice`, rolls a 6 sided die (terry)
Help command changed, the amount of commands in each category and overall is now displayed
added `inspire` as an alias for inspirobot
ship command
added find by mention to functions

View file

@ -1,10 +1,16 @@
const request = require("request"); const request = require("request");
exports.run = async (bot, message, args) => { exports.run = async (bot, message, args) => {
message.channel.startTyping();
try{
request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => { request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => {
if (error) throw new Error(error);
message.channel.send(`**Did you know?**\n ${body.data[0].fact}`); message.channel.send(`**Did you know?**\n ${body.data[0].fact}`);
message.channel.startTyping();
}); });
} catch(err) {
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
message.channel.stopTyping();
};
}; };
exports.conf = { exports.conf = {

View file

@ -1,10 +1,16 @@
const request = require("request"); const request = require("request");
exports.run = async (bot, message, args) => { exports.run = async (bot, message, args) => {
message.channel.startTyping();
try{
request({ uri: "https://dog-api.kinduff.com/api/facts", json: true }, (error, response, body) => { request({ uri: "https://dog-api.kinduff.com/api/facts", json: true }, (error, response, body) => {
if (error) throw new Error(error); message.channel.stopTyping();
message.channel.send(`**Did you know?**\n ${body.facts[0]}`); message.channel.send(`**Did you know?**\n ${body.facts[0]}`);
}); });
} catch(err) {
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
message.channel.stopTyping();
};
}; };
exports.conf = { exports.conf = {

31
src/commands/yoda.js Normal file
View file

@ -0,0 +1,31 @@
const request = require('request')
exports.run = async (client, message, args) => {
const speech = args.join(' ');
if (!args[0]) {
return message.channel.send(`<:error:466995152976871434> Please include text for me to convert to yodish. Yes.`)
}
try {
const { text } = request({ uri: `http://yoda-api.appspot.com/api/v1/yodish?text=${encodeURIComponent(speech.toLowerCase())}`, json: true }, (error, response, body) => {
message.channel.send(JSON.parse(text).yodish)
});
} catch(err) {
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
message.channel.stopTyping();
}
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["yoda","yodasay"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "yodish",
category: "Fun",
description: "Turns any text you input into yodish. Yes.",
usage: "yodish <text>"
};