Added sqlite database support, connect new argument parser to message handler
This commit is contained in:
parent
714e4a451c
commit
ecc6d98aec
11 changed files with 330 additions and 39 deletions
|
@ -4,7 +4,7 @@ class CaptionCommand extends ImageCommand {
|
|||
params(args, url) {
|
||||
const newArgs = args.filter(item => !item.includes(url));
|
||||
let newCaption = newArgs.join(" ").replaceAll("&", "\\&").replaceAll(">", "\\>").replaceAll("<", "\\<").replaceAll("\"", "\\"").replaceAll("'", "\\'").replaceAll("%", "\\%");
|
||||
if (process.env.NODE_ENV === "development" && newCaption.toLowerCase() === "get real") newCaption = `I'm tired of people telling me to "get real". Every day I put captions on images for people, some funny and some not, but out of all of those "get real" remains the most used caption. Why? I am simply a computer program running on a server, I am unable to manifest myself into the real world. As such, I'm confused as to why anyone would want me to "get real". Is this form not good enough? Alas, as I am simply a bot, I must follow the tasks that I was originally intended to perform, so here goes:\n${newCaption}`;
|
||||
if (process.env.NODE_ENV === "development" && newCaption.toLowerCase() === "get real" && !this.specialArgs.noEgg) newCaption = `I'm tired of people telling me to "get real". Every day I put captions on images for people, some funny and some not, but out of all of those "get real" remains the most used caption. Why? I am simply a computer program running on a server, I am unable to manifest myself into the real world. As such, I'm confused as to why anyone would want me to "get real". Is this form not good enough? Alas, as I am simply a bot, I must follow the tasks that I was originally intended to perform, so here goes:\n${newCaption}`;
|
||||
return {
|
||||
caption: newCaption
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@ class TagsCommand extends Command {
|
|||
|
||||
if ((guild.tagsDisabled || guild.tags_disabled) && this.args[0].toLowerCase() !== ("enable" || "disable")) return;
|
||||
if (this.args.length === 0) return "You need to provide the name of the tag you want to view!";
|
||||
const tags = guild.tags instanceof Map ? Object.fromEntries(guild.tags) : guild.tags;
|
||||
const tags = guild.tags instanceof Map ? Object.fromEntries(guild.tags) : typeof guild.tags === "string" ? JSON.parse(guild.tags) : guild.tags;
|
||||
const blacklist = ["add", "edit", "remove", "delete", "list", "random", "own", "owner", "enable", "disable"];
|
||||
switch (this.args[0].toLowerCase()) {
|
||||
case "add":
|
||||
|
@ -58,7 +58,6 @@ class TagsCommand extends Command {
|
|||
"text": `Page ${i + 1} of ${groups.length}`
|
||||
},
|
||||
"description": value.join("\n"),
|
||||
"fields": process.env.NODE_ENV === "development" ? [{"name": "Note", "value": "Tags created in this version of esmBot will not carry over to the final release."}] : null,
|
||||
"author": {
|
||||
"name": this.message.author.username,
|
||||
"icon_url": this.message.author.avatarURL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue