feat: add tag mentions and deletions

This commit is contained in:
Ryan Cao 2022-09-12 15:01:26 +08:00
parent 6673a8a36c
commit ff5882730d
No known key found for this signature in database
3 changed files with 38 additions and 2 deletions

View file

@ -10,6 +10,8 @@ export const tagsCommand = async (
) => {
const tags = await getTags();
const tagName = i.options.getString('name', true);
const mention = i.options.getUser('user', false);
const tag = tags.find(
(tag) => tag.name === tagName || tag.aliases?.includes(tagName)
);
@ -23,7 +25,9 @@ export const tagsCommand = async (
}
await i.reply({
content: tag.text ? `**${tag.name}**\n\n` + tag.text : tag.text,
content:
(mention ? `<@${mention.id}> ` : '') +
(tag.text ? `**${tag.name}**\n\n` + tag.text : ''),
embeds: tag.embed
? [
new EmbedBuilder(tag.embed).setFooter({