World: bot
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 messagesimport interactionsimport commandsimport dmsimport communityimport storageimport httpimport timersimport voiceimport audioimport logimport presenceuse types.{event, interaction, choice, registration}use voice.{voice-event}
Functions
Section titled “Functions”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.
on-config-change
Section titled “on-config-change”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.
on-event
Section titled “on-event”export on-event: func(event: event);A subscribed event.
on-interaction
Section titled “on-interaction”export on-interaction: func(interaction: interaction);An application command, component click or modal submit.
on-autocomplete
Section titled “on-autocomplete”export on-autocomplete: func(interaction: interaction) -> list<choice>;Autocomplete: return up to 25 choices for the focused option.
on-timer
Section titled “on-timer”export on-timer: func(id: u64, tag: string);A timer fired.
on-voice-event
Section titled “on-voice-event”export on-voice-event: func(event: voice-event);Something happened in the bot’s voice stay or player.