# World: bot

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

Generated from `zaun:bot@0.2.0` (`wit/` in [zaun-bot](https://github.com/zaunchat/zaun-bot)). Do not edit.

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

## Uses

- `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}`

## Functions

### `init`

```wit
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`

```wit
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`

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

A subscribed event.

### `on-interaction`

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

An application command, component click or modal submit.

### `on-autocomplete`

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

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

### `on-timer`

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

A timer fired.

### `on-voice-event`

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

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