update tags to allow for matrix html funnies

This commit is contained in:
murm 2023-03-17 01:42:28 -04:00
parent 8f8d5972aa
commit 47700fce82
1 changed files with 4 additions and 4 deletions

View File

@ -20,7 +20,7 @@ class TagsCommand extends Command {
const result = await database.setTag(tagName, { content: this.type === "classic" ? this.args.slice(2).join(" ") : this.optionsArray[0].options[1].value, author: this.message.sender }, this.channel);
this.success = true;
if (result) return result;
return `The tag \`${tagName}\` has been added!`;
return { html: `The tag <font color=\"#ff00ff\">${tagName}</font> has been <b>added</b>!` };
} 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);
@ -29,7 +29,7 @@ class TagsCommand extends Command {
if (getResult.author !== this.author && !owners.includes(this.author)) return "You don't own this tag!";
await database.removeTag(tagName, this.channel);
this.success = true;
return `The tag \`${tagName}\` has been deleted!`;
return { html: `The tag <font color=\"#ff00ff\">${tagName}</font> has been <b>deleted</b>!` };
} 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);
@ -38,7 +38,7 @@ class TagsCommand extends Command {
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.message.sender }, this.channel);
this.success = true;
return `The tag \`${tagName}\` has been edited!`;
return { html: `The tag <font color=\"#ff00ff\">${tagName}</font> has been <b>edited</b>!` };
} 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);
@ -102,7 +102,7 @@ class TagsCommand extends Command {
}],
};
}
return getResult.content;
return { html: getResult.content };
}
}