From 47ea6d92dd4386e3486fb9df5a0a532585307e70 Mon Sep 17 00:00:00 2001 From: xhyrom Date: Thu, 14 Apr 2022 12:47:20 +0200 Subject: [PATCH] fix --- packages/bot/bot.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/bot/bot.ts b/packages/bot/bot.ts index 83c7603..d6470e4 100644 --- a/packages/bot/bot.ts +++ b/packages/bot/bot.ts @@ -11,7 +11,6 @@ export const handleRequest = async(request: Request): Promise => { const interaction = await request.json() as APIPingInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction; - console.log(interaction); if (interaction.type === InteractionType.Ping) return respond({ type: InteractionResponseType.Pong @@ -38,7 +37,7 @@ export const handleRequest = async(request: Request): Promise => { if (!message) message = '​'; if (!roles || Object.values(json.roles).filter((role: any) => role.id && role.label).length === 0 || roles.length === 0 || roles.length > 25) return badFormatting(roles.length > 25); - const finalComponents = json.type === 1 ? resolveButtonComponents(roles) : resolveSelectMenuComponents(roles, json.placeholder?.toString()); + const finalComponents = json.type === "1" ? resolveButtonComponents(roles) : resolveSelectMenuComponents(roles, json.placeholder?.toString()); const fetched = await fetch(`${RouteBases.api}/channels/${channelId}/messages`, { method: 'POST', @@ -56,7 +55,7 @@ export const handleRequest = async(request: Request): Promise => { type: InteractionResponseType.ChannelMessageWithSource, data: { flags: 64, - content: fetched?.ok ? 'Done!' : 'Error, bad channel id/missing permissions.' + content: fetched?.ok ? 'Done!' : 'Error, bad channel id/missing permissions/invalid emojis.' } }); } else if (interaction.type === InteractionType.MessageComponent) {