mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-11-22 14:41: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");
|
].join("\n");
|
||||||
|
|
||||||
|
// @ts-expect-error allowed_mentions
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
content,
|
content,
|
||||||
// allowedMentions: {
|
allowed_mentions: {
|
||||||
// parse: ["users"],
|
parse: target ? ["users"] : [],
|
||||||
// }
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
} satisfies ApplicationCommand;
|
} satisfies ApplicationCommand;
|
||||||
|
|
|
@ -92,6 +92,7 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error allowed_mentions
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
content: [
|
content: [
|
||||||
`${result.emoji.type} ${result.emoji.state} [#${
|
`${result.emoji.type} ${result.emoji.state} [#${
|
||||||
|
@ -101,6 +102,9 @@ export default {
|
||||||
}>) ${stateToText(result)} ${stateToTimestamp(result)}`,
|
}>) ${stateToText(result)} ${stateToTimestamp(result)}`,
|
||||||
result.title,
|
result.title,
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
|
allowed_mentions: {
|
||||||
|
parse: [],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -101,11 +101,15 @@ export default {
|
||||||
intro,
|
intro,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// @ts-expect-error allowed_mentions
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
content: [
|
content: [
|
||||||
target ? `*Suggestion for <@${target}>:*\n` : "",
|
target ? `*Suggestion for <@${target}>:*\n` : "",
|
||||||
parts.join("\n"),
|
parts.join("\n"),
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
|
allowed_mentions: {
|
||||||
|
parse: target ? ["users"] : [],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
autocomplete: async (interaction) => {
|
autocomplete: async (interaction) => {
|
||||||
|
|
|
@ -32,15 +32,16 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error allowed_mentions
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
content: [
|
content: [
|
||||||
target ? `*Suggestion for <@${target}>:*\n` : "",
|
target ? `*Suggestion for <@${target}>:*\n` : "",
|
||||||
`**${tag.question}**`,
|
`**${tag.question}**`,
|
||||||
tag.answer,
|
tag.answer,
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
// allowedMentions: {
|
allowed_mentions: {
|
||||||
// parse: ["users"]
|
parse: target ? ["users"] : [],
|
||||||
// }
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
autocomplete: async (interaction) => {
|
autocomplete: async (interaction) => {
|
||||||
|
|
|
@ -13,20 +13,25 @@ export default {
|
||||||
|
|
||||||
const tag = searchTag(await message.fetchChannel(), keyword, false);
|
const tag = searchTag(await message.fetchChannel(), keyword, false);
|
||||||
if (!keyword || !tag) {
|
if (!keyword || !tag) {
|
||||||
|
// @ts-expect-error allowed_mentions
|
||||||
return message.reply({
|
return message.reply({
|
||||||
content: `\`❌\` Could not find a tag \`${keyword}\``,
|
content: `\`❌\` Could not find a tag \`${keyword}\``,
|
||||||
|
allowed_mentions: {
|
||||||
|
parse: [],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error allowed_mentions
|
||||||
message.reply({
|
message.reply({
|
||||||
content: [
|
content: [
|
||||||
resolvedTarget ? `*Suggestion for <@${resolvedTarget.id}>:*\n` : "",
|
resolvedTarget ? `*Suggestion for <@${resolvedTarget.id}>:*\n` : "",
|
||||||
`**${tag.question}**`,
|
`**${tag.question}**`,
|
||||||
tag.answer,
|
tag.answer,
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
// allowedMentions: {
|
allowed_mentions: {
|
||||||
// parse: ["users"]
|
parse: resolvedTarget ? ["users"] : [],
|
||||||
// }
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
} satisfies MessageCommand;
|
} satisfies MessageCommand;
|
||||||
|
|
Loading…
Reference in a new issue