fix: don't allow mentions p. 2

This commit is contained in:
Jozef Steinhübl 2024-05-11 00:35:17 +02:00
parent 6ce4a36feb
commit 4abdefa7a4
No known key found for this signature in database
GPG key ID: E6BC90C91973B08F
3 changed files with 20 additions and 1 deletions

View file

@ -86,8 +86,12 @@ export default {
const result = (await search(query, state, type))[0]; const result = (await search(query, state, type))[0];
if (!result) { if (!result) {
// @ts-expect-error allowed_mentions
interaction.editReply({ interaction.editReply({
content: `❌ Couldn't find issue or pull request \`${query}\``, content: `❌ Couldn't find issue or pull request \`${query}\``,
allowed_mentions: {
parse: [],
},
}); });
return; return;
} }

View file

@ -26,9 +26,13 @@ export default {
const tag = searchTag(interaction.channel, query, false); const tag = searchTag(interaction.channel, query, false);
if (!tag) { if (!tag) {
// @ts-expect-error allowed_mentions
return interaction.reply({ return interaction.reply({
content: `\`\` Could not find a tag \`${query}\``, content: `\`\` Could not find a tag \`${query}\``,
ephemeral: true, ephemeral: true,
allowed_mentions: {
parse: [],
},
}); });
} }

View file

@ -92,6 +92,7 @@ async function handleGithubLink(message: Message): Promise<void> {
if (extension === "zig") extension = "rs"; if (extension === "zig") extension = "rs";
// @ts-expect-error allowed_mentions
message.reply({ message.reply({
content: `***${basename(path)}*** — *(L${firstLineNumber + 1}${ content: `***${basename(path)}*** — *(L${firstLineNumber + 1}${
secondLineNumber ? `-L${secondLineNumber}` : "" secondLineNumber ? `-L${secondLineNumber}` : ""
@ -110,6 +111,9 @@ async function handleGithubLink(message: Message): Promise<void> {
/> />
</ActionRow>, </ActionRow>,
], ],
allowed_mentions: {
parse: [],
},
}); });
} }
@ -120,7 +124,14 @@ async function handleBunReportLink(message: Message): Promise<void> {
if (!match?.[0]) return; if (!match?.[0]) return;
const data = await getBunReportDetailsInMarkdown(match[0]); const data = await getBunReportDetailsInMarkdown(match[0]);
message.reply(data);
// @ts-expect-error allowed_mentions
message.reply({
content: data,
allowed_mentions: {
parse: [],
},
});
} }
function handleTwitterLink(message: Message): void { function handleTwitterLink(message: Message): void {