calcom / cal.com

Scheduling infrastructure for absolutely everyone.
https://cal.com
Other
32.47k stars 8.03k forks source link

Discord webhook is not working. #14444

Open dninomiya opened 7 months ago

dninomiya commented 7 months ago

Discord webhook is not working.

The test ping is sent successfully, but I don't receive any notification of the actual reservation. Am I missing something?

image

Test ping is successful in this screenshot. However, you will not receive an actual reservation notification.

Thank you for your support!

dosubot[bot] commented 7 months ago

Based on the information you've provided and the context from the cal.com repository, it seems like the issue might be related to the handling of reservation notifications via Discord webhooks. While the cal.com codebase does support Discord webhook integration and has a function for sending a test ping to Discord, it's not clear if there's a specific function or method that handles sending reservation notifications to Discord via webhooks.

The mutation.mutate method call with the parameters { url: subscriberUrl, secret: webhookSecret, type: "PING", payloadTemplate } is responsible for sending the test ping to Discord. This is found within the onClick event handler of the Button component in the WebhookTestDisclosure component. The mutation object is created by calling trpc.viewer.webhook.testTrigger.useMutation(). You can find this in the WebhookTestDisclosure.tsx file.

The SQL migration script indicates the addition of 'BOOKING_REQUESTED' and 'BOOKING_REJECTED' values to the "WebhookTriggerEvents" enum type. This suggests that the system is equipped to trigger webhook events for booking requests and rejections, which can be utilized to send notifications to various platforms, including Discord, by configuring webhooks accordingly. You can find this in the migration.sql file.

The function named createFunction in the webhooks-view.tsx file is responsible for handling the creation and configuration of Discord webhooks. This function navigates the user to a new page for creating webhooks based on provided parameters.

Given this information, I would suggest checking the configuration of your webhook in Discord and in your cal.com settings. Make sure that the webhook URL and other settings match exactly. Also, ensure that the 'BOOKING_REQUESTED' and 'BOOKING_REJECTED' events are properly configured to trigger the webhook.

If the issue persists, it would be helpful to have more information about the specific steps you're taking when setting up the webhook and any error messages you're seeing. This will help in identifying if there's a bug in the codebase or if there's something specific to your setup causing the issue.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.