i did a lot so i'll just put this here lol

This commit is contained in:
rhearmas 2019-12-22 21:46:54 -05:00
parent 20e51cf8a7
commit d69a7d971a
9 changed files with 23 additions and 26 deletions

View file

@ -21,7 +21,7 @@ const getInverseReplacements = replacements => {
}; };
exports.run = function (bot, message, args) { exports.run = function (bot, message, args) {
const parsedArgs = bot.utils.parseArgs(args, ['e', 't']); const parsedArgs = client.parseArgs(args, ['e', 't']);
if (parsedArgs.leftover.length < 1) { if (parsedArgs.leftover.length < 1) {
throw 'Provide text to be leeted.'; throw 'Provide text to be leeted.';

View file

@ -5,7 +5,7 @@ exports.run = async (client, message, args, level) => {
message.delete(); message.delete();
return (await message.channel.send("Please provide some text to clapify")).delete(5000); return (await message.channel.send("Please provide some text to clapify")).delete(5000);
} }
message.delete();
message.channel.send(args.map(randomizeCase).join(':clap:')); message.channel.send(args.map(randomizeCase).join(':clap:'));
}; };

View file

@ -1,22 +0,0 @@
exports.run = async (client, message, args, level) => {
const response = await client.awaitReply(message, "Hey, what's your favorite color?");
if(response !== "black") {
message.reply(`Oh, I really love ${response} too!`);
} else {
message.reply(`you like ${response}? Disgusting.`);
}
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User"
};
exports.help = {
name: "color",
category: "Fun",
description: "Who likes a color?",
usage: "color"
};

View file

@ -25,7 +25,7 @@ exports.run = async (client, message, args, level) => {
message.delete(); message.delete();
return (await message.reply("Please specify something to ask of the magic 8-ball!")).delete(5000); return (await message.reply("Please specify something to ask of the magic 8-ball!")).delete(5000);
} }
message.delete();
message.channel.send( message.channel.send(
args.join(' ') args.join(' ')
.split('') .split('')

View file

@ -5,7 +5,7 @@ exports.run = async (client, message, args) => {
await message.delete(); await message.delete();
if(args.length == 0) if(args.length == 0)
return message.reply("Please insert a valid message.") return message.reply("please insert a valid message.")
.then(msg => { .then(msg => {
msg.delete(5000).catch(e => {e}) msg.delete(5000).catch(e => {e})
}) })

View file

@ -18,4 +18,13 @@ exports.help = {
usage: "" usage: ""
}; };
*/
/* Basic message auto-deletion
if (!args[0]) {
message.delete();
return (await message.reply("text")).delete(5000);
}
*/ */

View file

@ -154,6 +154,8 @@ module.exports = (client) => {
client.wait = require("util").promisify(setTimeout); client.wait = require("util").promisify(setTimeout);
client.randomSelection = choices => choices[Math.floor(Math.random() * choices.length)];
process.on("uncaughtException", (err) => { process.on("uncaughtException", (err) => {
const errorMsg = err.stack.replace(new RegExp(`${__dirname}/`, "g"), "./"); const errorMsg = err.stack.replace(new RegExp(`${__dirname}/`, "g"), "./");
client.logger.error(`Uncaught Exception: ${errorMsg}`); client.logger.error(`Uncaught Exception: ${errorMsg}`);
@ -363,4 +365,6 @@ module.exports = (client) => {
} }
}); });
}; };
client.quoteRegex = input => `${input}`.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&');
}; };

5
package-lock.json generated
View file

@ -608,6 +608,11 @@
"signal-exit": "^3.0.2" "signal-exit": "^3.0.2"
} }
}, },
"roll": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/roll/-/roll-1.2.0.tgz",
"integrity": "sha1-9LlQUZBpVXOe0+8ACkE5VaqwaiI="
},
"run-async": { "run-async": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",

View file

@ -33,6 +33,7 @@
"moment": "^2.24.0", "moment": "^2.24.0",
"moment-duration-format": "^2.3.2", "moment-duration-format": "^2.3.2",
"recrawl": "^2.0.0", "recrawl": "^2.0.0",
"roll": "^1.2.0",
"webdict": "^0.3.0" "webdict": "^0.3.0"
}, },
"publishConfig": { "publishConfig": {