Bot Playground/Examples/Webhooks

From SmartBots Developers Docs
Bot PlaygroundExamples
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 ==...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Example of using a webhook:

  1. creating a webhook,
  2. displaying its details,
  3. sending data from a remote server,
  4. 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);