diff --git a/src/helpers/messages/send_message.ts b/src/helpers/messages/send_message.ts index 9bcb2372e..590573b51 100644 --- a/src/helpers/messages/send_message.ts +++ b/src/helpers/messages/send_message.ts @@ -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( "post", endpoints.CHANNEL_MESSAGES(channelId),