mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
change: validate components at start
This commit is contained in:
@@ -47,6 +47,10 @@ export async function sendMessage(channelId: bigint, content: string | CreateMes
|
||||
throw new Error(Errors.MESSAGE_MAX_LENGTH);
|
||||
}
|
||||
|
||||
if (content.components?.length) {
|
||||
validateComponents(content.components);
|
||||
}
|
||||
|
||||
if (content.allowedMentions) {
|
||||
if (content.allowedMentions.users?.length) {
|
||||
if (content.allowedMentions.parse?.includes(DiscordAllowedMentionsTypes.UserMentions)) {
|
||||
@@ -69,10 +73,6 @@ export async function sendMessage(channelId: bigint, content: string | CreateMes
|
||||
}
|
||||
}
|
||||
|
||||
if (content.components?.length) {
|
||||
validateComponents(content.components);
|
||||
}
|
||||
|
||||
const result = await rest.runMethod<Message>(
|
||||
"post",
|
||||
endpoints.CHANNEL_MESSAGES(channelId),
|
||||
|
||||
Reference in New Issue
Block a user