Skip to content

Generated from zaun:bot@0.2.0 (wit/ in zaun-bot). Do not edit.

A Zaun bot. The host calls one export at a time.

  • import messages
  • import interactions
  • import commands
  • import dms
  • import community
  • import storage
  • import http
  • import timers
  • import voice
  • import audio
  • import log
  • import presence
  • use types.{event, interaction, choice, registration}
  • use voice.{voice-event}
export init: func(config: list<tuple<string, string>>) -> registration;

Called once per instance start with the bot’s configuration: the keys its manifest declares in [config], each with the owner’s value or else the declared default (keys with neither are left out). Secret values are passed like any other.

export on-config-change: func(config: list<tuple<string, string>>);

The owner changed the configuration while the bot runs: every value again, as for init. The instance is not restarted and its commands stay registered.

export on-event: func(event: event);

A subscribed event.

export on-interaction: func(interaction: interaction);

An application command, component click or modal submit.

export on-autocomplete: func(interaction: interaction) -> list<choice>;

Autocomplete: return up to 25 choices for the focused option.

export on-timer: func(id: u64, tag: string);

A timer fired.

export on-voice-event: func(event: voice-event);

Something happened in the bot’s voice stay or player.