Bot Playground/Examples/Webhooks
From SmartBots Developers Docs
								Revision as of 10:08, 11 August 2025 by Gg (Talk | contribs) (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 ==...")
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);