Difference between revisions of "Bot Playground/Examples/Webhooks"
From SmartBots Developers Docs
(Created page with "Example of using a webhook: # creating a webhook, # displaying its details, # sending data from a remote server, # receiving these data in a script. == Playground script ==...") |
(No difference)
|
Revision as of 10:08, 11 August 2025
Example of using a webhook:
- creating a webhook,
- displaying its details,
- sending data from a remote server,
- receiving these data in a script.
Playground script
Bot.on("playground_webhook", (event) => {
console.log("Webhook received:", event);
});
// 1. Create a webhook
const webhook = await http.requestWebhook(); // Requests the webhook URL and token
// 2. Display its data
console.log("Webhook details:", webhook);