mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-21 22:21:05 +01:00
fix: don't allow mentions
This commit is contained in:
parent
4136d52f67
commit
c7f7ddd1a3
5 changed files with 24 additions and 9 deletions
|
@ -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;
|
||||
|
|
|
@ -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: [],
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue