Compare commits

...

2 commits

Author SHA1 Message Date
murm
e9d6a0fe48 mmmmmmmmmmmm imag...... 2023-03-17 01:01:12 -04:00
murm
b4c5885435 tweak tags cmd, try and fail to fix natives 2023-03-17 01:00:59 -04:00
29 changed files with 30 additions and 29 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
assets/images/city17.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

BIN
assets/images/garfield.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 KiB

BIN
assets/images/jjos.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

BIN
assets/images/kirby.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 KiB

BIN
assets/images/mania.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

BIN
assets/images/maniabg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
assets/images/meemay.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

BIN
assets/images/memer34.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
assets/images/myjesus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 KiB

BIN
assets/images/paint.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

BIN
assets/images/pixel.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/images/processor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 KiB

BIN
assets/images/retro.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
assets/images/safety.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/images/trump.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

BIN
assets/images/ugly.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
assets/images/walmart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View file

@ -8,7 +8,6 @@ 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;
@ -16,7 +15,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.guild.id, tagName);
const getResult = await database.getTag(this.channel, 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;
@ -24,25 +23,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.guild.id, tagName);
const getResult = await database.getTag(this.channel, tagName);
if (!getResult) return "This tag doesn't exist!";
const owners = process.env.OWNER.split(",");
if (getResult.author !== this.author && !this.member.permissions.has("MANAGE_MESSAGES") && !owners.includes(this.author)) return "You don't own this tag!";
if (getResult.author !== this.author && !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.guild.id, tagName);
const getResult = await database.getTag(this.channel, tagName);
if (!getResult) return "This tag doesn't exist!";
const owners = process.env.OWNER.split(",");
if (getResult.author !== this.author && !this.member.permissions.has("MANAGE_MESSAGES") && !owners.includes(this.author)) return "You don't own this tag!";
if (getResult.author !== this.author && !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.guild.id, tagName);
const getResult = await database.getTag(this.channel, tagName);
if (!getResult) return "This tag doesn't exist!";
const user = this.client.users.get(getResult.author);
this.success = true;
@ -58,39 +57,41 @@ 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.guild.id);
const tagList = await database.getTags(this.channel);
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;
});
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()
}
}]
});
}
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()
// // }
// // }]
// // });
// }
if (embeds.length === 0) return "I couldn't find any tags!";
this.success = true;
return paginator(this.client, { type: this.type, message: this.message, interaction: this.interaction, channel: this.channel, author: this.author }, embeds);
return output;
// 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.guild.id);
const tagList = await database.getTags(this.channel);
getResult = tagList[random(Object.keys(tagList))];
} else {
getResult = await database.getTag(this.guild.id, this.type === "classic" ? cmd : tagName);
getResult = await database.getTag(this.channel, this.type === "classic" ? cmd : tagName);
}
if (!getResult) return "This tag doesn't exist!";
this.success = true;

View file

@ -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 = GetArgument<bool>(Arguments, "implode");
bool implode = GetArgumentWithFallback<bool>(Arguments, "implode", false);
string basePath = GetArgument<string>(Arguments, "basePath");
VOption *options = VImage::option();

View file

@ -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 = GetArgument<string>(Arguments, "text");
string text = GetArgumentWithFallback<string>(Arguments, "text", "");
string basePath = GetArgument<string>(Arguments, "basePath");
VOption *options = VImage::option()->set("access", "sequential");