diff --git a/assets/images/blackpixel.png b/assets/images/blackpixel.png deleted file mode 100644 index f16db4d..0000000 Binary files a/assets/images/blackpixel.png and /dev/null differ diff --git a/assets/images/city17.png b/assets/images/city17.png deleted file mode 100644 index 0026155..0000000 Binary files a/assets/images/city17.png and /dev/null differ diff --git a/assets/images/gametheory.png b/assets/images/gametheory.png deleted file mode 100644 index b1d4ec0..0000000 Binary files a/assets/images/gametheory.png and /dev/null differ diff --git a/assets/images/garfield.png b/assets/images/garfield.png deleted file mode 100644 index a4fb356..0000000 Binary files a/assets/images/garfield.png and /dev/null differ diff --git a/assets/images/jacksfilms.png b/assets/images/jacksfilms.png deleted file mode 100644 index d7abd6d..0000000 Binary files a/assets/images/jacksfilms.png and /dev/null differ diff --git a/assets/images/jjos.png b/assets/images/jjos.png deleted file mode 100644 index b33f7cd..0000000 Binary files a/assets/images/jjos.png and /dev/null differ diff --git a/assets/images/kirby.png b/assets/images/kirby.png deleted file mode 100644 index b6ee33c..0000000 Binary files a/assets/images/kirby.png and /dev/null differ diff --git a/assets/images/mania.png b/assets/images/mania.png deleted file mode 100644 index 77c15dd..0000000 Binary files a/assets/images/mania.png and /dev/null differ diff --git a/assets/images/maniabg.png b/assets/images/maniabg.png deleted file mode 100644 index 0e32d32..0000000 Binary files a/assets/images/maniabg.png and /dev/null differ diff --git a/assets/images/mariomirror.png b/assets/images/mariomirror.png deleted file mode 100644 index 06ffdd0..0000000 Binary files a/assets/images/mariomirror.png and /dev/null differ diff --git a/assets/images/markiplier.png b/assets/images/markiplier.png deleted file mode 100644 index d1d9f2e..0000000 Binary files a/assets/images/markiplier.png and /dev/null differ diff --git a/assets/images/meemay.png b/assets/images/meemay.png deleted file mode 100644 index 25a188f..0000000 Binary files a/assets/images/meemay.png and /dev/null differ diff --git a/assets/images/memer34.png b/assets/images/memer34.png deleted file mode 100644 index cbf3388..0000000 Binary files a/assets/images/memer34.png and /dev/null differ diff --git a/assets/images/myjesus.png b/assets/images/myjesus.png deleted file mode 100644 index f22a82d..0000000 Binary files a/assets/images/myjesus.png and /dev/null differ diff --git a/assets/images/numberphile.png b/assets/images/numberphile.png deleted file mode 100644 index dd357bf..0000000 Binary files a/assets/images/numberphile.png and /dev/null differ diff --git a/assets/images/paint.png b/assets/images/paint.png deleted file mode 100644 index cc144a6..0000000 Binary files a/assets/images/paint.png and /dev/null differ diff --git a/assets/images/pixel.png b/assets/images/pixel.png deleted file mode 100644 index 3772f66..0000000 Binary files a/assets/images/pixel.png and /dev/null differ diff --git a/assets/images/processor.png b/assets/images/processor.png deleted file mode 100644 index 5b5ee6c..0000000 Binary files a/assets/images/processor.png and /dev/null differ diff --git a/assets/images/retro.png b/assets/images/retro.png deleted file mode 100644 index 2152ae8..0000000 Binary files a/assets/images/retro.png and /dev/null differ diff --git a/assets/images/safety.png b/assets/images/safety.png deleted file mode 100644 index 0b5309e..0000000 Binary files a/assets/images/safety.png and /dev/null differ diff --git a/assets/images/steamupdate.png b/assets/images/steamupdate.png deleted file mode 100644 index d578c20..0000000 Binary files a/assets/images/steamupdate.png and /dev/null differ diff --git a/assets/images/trump.png b/assets/images/trump.png deleted file mode 100644 index 119d7dc..0000000 Binary files a/assets/images/trump.png and /dev/null differ diff --git a/assets/images/ugly.png b/assets/images/ugly.png deleted file mode 100644 index 9454f1b..0000000 Binary files a/assets/images/ugly.png and /dev/null differ diff --git a/assets/images/victoryroyale.png b/assets/images/victoryroyale.png deleted file mode 100644 index e243a18..0000000 Binary files a/assets/images/victoryroyale.png and /dev/null differ diff --git a/assets/images/walmart.png b/assets/images/walmart.png deleted file mode 100644 index 278d661..0000000 Binary files a/assets/images/walmart.png and /dev/null differ diff --git a/assets/images/whodidthis.png b/assets/images/whodidthis.png deleted file mode 100644 index ae04d53..0000000 Binary files a/assets/images/whodidthis.png and /dev/null differ diff --git a/commands/tags/tags.js b/commands/tags/tags.js index f9d6364..aaae49a 100644 --- a/commands/tags/tags.js +++ b/commands/tags/tags.js @@ -8,6 +8,7 @@ class TagsCommand extends Command { // todo: attempt to not make this file the worst thing that human eyes have ever seen async run() { this.success = false; + if (!this.guild) return "This command only works in servers!"; const cmd = this.type === "classic" ? (this.args[0] ?? "").toLowerCase() : this.optionsArray[0].name; if (!cmd || !cmd.trim()) return "You need to provide the name of the tag you want to view!"; const tagName = this.type === "classic" ? this.args.slice(1)[0] : (this.optionsArray[0].options[0] ?? {}).value; @@ -15,7 +16,7 @@ class TagsCommand extends Command { if (cmd === "create" || cmd === "add") { if (!tagName || !tagName.trim()) return "You need to provide the name of the tag you want to add!"; if (blacklist.includes(tagName)) return "You can't make a tag with that name!"; - const getResult = await database.getTag(this.channel, tagName); + const getResult = await database.getTag(this.guild.id, tagName); if (getResult) return "This tag already exists!"; const result = await database.setTag(tagName, { content: this.type === "classic" ? this.args.slice(2).join(" ") : this.optionsArray[0].options[1].value, author: this.member.id }, this.guild); this.success = true; @@ -23,25 +24,25 @@ class TagsCommand extends Command { return `The tag \`${tagName}\` has been added!`; } else if (cmd === "delete" || cmd === "remove") { if (!tagName || !tagName.trim()) return "You need to provide the name of the tag you want to delete!"; - const getResult = await database.getTag(this.channel, tagName); + const getResult = await database.getTag(this.guild.id, tagName); if (!getResult) return "This tag doesn't exist!"; const owners = process.env.OWNER.split(","); - if (getResult.author !== this.author && !owners.includes(this.author)) return "You don't own this tag!"; + if (getResult.author !== this.author && !this.member.permissions.has("MANAGE_MESSAGES") && !owners.includes(this.author)) return "You don't own this tag!"; await database.removeTag(tagName, this.guild); this.success = true; return `The tag \`${tagName}\` has been deleted!`; } else if (cmd === "edit") { if (!tagName || !tagName.trim()) return "You need to provide the name of the tag you want to edit!"; - const getResult = await database.getTag(this.channel, tagName); + const getResult = await database.getTag(this.guild.id, tagName); if (!getResult) return "This tag doesn't exist!"; const owners = process.env.OWNER.split(","); - if (getResult.author !== this.author && !owners.includes(this.author)) return "You don't own this tag!"; + if (getResult.author !== this.author && !this.member.permissions.has("MANAGE_MESSAGES") && !owners.includes(this.author)) return "You don't own this tag!"; await database.editTag(tagName, { content: this.type === "classic" ? this.args.slice(2).join(" ") : this.optionsArray[0].options[1].value, author: this.member.id }, this.guild); this.success = true; return `The tag \`${tagName}\` has been edited!`; } else if (cmd === "own" || cmd === "owner") { if (!tagName || !tagName.trim()) return "You need to provide the name of the tag you want to check the owner of!"; - const getResult = await database.getTag(this.channel, tagName); + const getResult = await database.getTag(this.guild.id, tagName); if (!getResult) return "This tag doesn't exist!"; const user = this.client.users.get(getResult.author); this.success = true; @@ -57,41 +58,39 @@ class TagsCommand extends Command { } } else if (cmd === "list") { if (!this.channel.permissionsOf(this.client.user.id.toString()).has("EMBED_LINKS")) return "I don't have the `Embed Links` permission!"; - const tagList = await database.getTags(this.channel); + const tagList = await database.getTags(this.guild.id); const embeds = []; const groups = Object.keys(tagList).map((item, index) => { return index % 15 === 0 ? Object.keys(tagList).slice(index, index + 15) : null; }).filter((item) => { return item; }); - let output = JSON.stringify(groups.entries()); - // for (const [i, value] of groups.entries()) { - // // embeds.push({ - // // embeds: [{ - // // title: "Tag List", - // // color: 16711680, - // // footer: { - // // text: `Page ${i + 1} of ${groups.length}` - // // }, - // // description: value.join("\n"), - // // author: { - // // name: this.author.username, - // // iconURL: this.author.avatarURL() - // // } - // // }] - // // }); - // } + for (const [i, value] of groups.entries()) { + embeds.push({ + embeds: [{ + title: "Tag List", + color: 16711680, + footer: { + text: `Page ${i + 1} of ${groups.length}` + }, + description: value.join("\n"), + author: { + name: this.author.username, + iconURL: this.author.avatarURL() + } + }] + }); + } if (embeds.length === 0) return "I couldn't find any tags!"; this.success = true; - return output; - // return paginator(this.client, { type: this.type, message: this.message, interaction: this.interaction, channel: this.channel, author: this.author }, embeds); + return paginator(this.client, { type: this.type, message: this.message, interaction: this.interaction, channel: this.channel, author: this.author }, embeds); } else { let getResult; if (cmd === "random") { - const tagList = await database.getTags(this.channel); + const tagList = await database.getTags(this.guild.id); getResult = tagList[random(Object.keys(tagList))]; } else { - getResult = await database.getTag(this.channel, this.type === "classic" ? cmd : tagName); + getResult = await database.getTag(this.guild.id, this.type === "classic" ? cmd : tagName); } if (!getResult) return "This tag doesn't exist!"; this.success = true; diff --git a/natives/explode.cc b/natives/explode.cc index 2df37e9..ae9ba41 100644 --- a/natives/explode.cc +++ b/natives/explode.cc @@ -7,7 +7,7 @@ using namespace vips; char *Explode(string type, string *outType, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { - bool implode = GetArgumentWithFallback(Arguments, "implode", false); + bool implode = GetArgument(Arguments, "implode"); string basePath = GetArgument(Arguments, "basePath"); VOption *options = VImage::option(); diff --git a/natives/reddit.cc b/natives/reddit.cc index a09027f..805492c 100644 --- a/natives/reddit.cc +++ b/natives/reddit.cc @@ -7,7 +7,7 @@ using namespace vips; char *Reddit(string type, string *outType, char *BufferData, size_t BufferLength, ArgumentMap Arguments, size_t *DataSize) { - string text = GetArgumentWithFallback(Arguments, "text", ""); + string text = GetArgument(Arguments, "text"); string basePath = GetArgument(Arguments, "basePath"); VOption *options = VImage::option()->set("access", "sequential");