Skip to main content

Webhook and Webhooks

Import both classes from talos-fluxer or talos-fluxer/resources. Management uses the bot credential. Message execution uses the webhook’s own execution token. See the source.

Webhook

Obtain from channel.createWebhook(body), channel.webhooks(), or client.webhooks.fetch(id). Constructor: new Webhook(data, resources). Properties: id and inherited data and toJSON(). The execution token is held privately and removed from the exposed snapshot and its JSON representation. Execution and message methods throw if the original API response had no execution token. Metadata operations use the bot’s REST authentication. An edit returns a new snapshot; it does not modify the original wrapper.

Webhooks

Available as client.webhooks or resources.webhooks. Constructor: new Webhooks(resources). execute() requests wait=true so the API returns the resulting message. Its options accept files, signal, timeoutMs, and reason. It does not store the execution token in a resource object.
Use channel.createWebhook() for creation and channel.webhooks() for listing.