fix: don't allow mentions

This commit is contained in:
Jozef Steinhübl 2024-05-10 16:13:35 +02:00
parent 4136d52f67
commit c7f7ddd1a3
No known key found for this signature in database
GPG key ID: E6BC90C91973B08F
5 changed files with 24 additions and 9 deletions

View file

@ -75,11 +75,12 @@ export default {
: "",
].join("\n");
// @ts-expect-error allowed_mentions
await interaction.editReply({
content,
// allowedMentions: {
// parse: ["users"],
// }
allowed_mentions: {
parse: target ? ["users"] : [],
},
});
},
} satisfies ApplicationCommand;

View file

@ -92,6 +92,7 @@ export default {
return;
}
// @ts-expect-error allowed_mentions
interaction.editReply({
content: [
`${result.emoji.type} ${result.emoji.state} [#${
@ -101,6 +102,9 @@ export default {
}>) ${stateToText(result)} ${stateToTimestamp(result)}`,
result.title,
].join("\n"),
allowed_mentions: {
parse: [],
},
});
},

View file

@ -101,11 +101,15 @@ export default {
intro,
];
// @ts-expect-error allowed_mentions
await interaction.editReply({
content: [
target ? `*Suggestion for <@${target}>:*\n` : "",
parts.join("\n"),
].join("\n"),
allowed_mentions: {
parse: target ? ["users"] : [],
},
});
},
autocomplete: async (interaction) => {

View file

@ -32,15 +32,16 @@ export default {
});
}
// @ts-expect-error allowed_mentions
await interaction.reply({
content: [
target ? `*Suggestion for <@${target}>:*\n` : "",
`**${tag.question}**`,
tag.answer,
].join("\n"),
// allowedMentions: {
// parse: ["users"]
// }
allowed_mentions: {
parse: target ? ["users"] : [],
},
});
},
autocomplete: async (interaction) => {

View file

@ -13,20 +13,25 @@ export default {
const tag = searchTag(await message.fetchChannel(), keyword, false);
if (!keyword || !tag) {
// @ts-expect-error allowed_mentions
return message.reply({
content: `\`\` Could not find a tag \`${keyword}\``,
allowed_mentions: {
parse: [],
},
});
}
// @ts-expect-error allowed_mentions
message.reply({
content: [
resolvedTarget ? `*Suggestion for <@${resolvedTarget.id}>:*\n` : "",
`**${tag.question}**`,
tag.answer,
].join("\n"),
// allowedMentions: {
// parse: ["users"]
// }
allowed_mentions: {
parse: resolvedTarget ? ["users"] : [],
},
});
},
} satisfies MessageCommand;