> ## Documentation Index
> Fetch the complete documentation index at: https://mikting.docs.komo.moe/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Quick start, follow-ups, variables, and script validation.

Mikting is an ItsMyBot addon for writing Discord bot scripts in YAML. It adds
HTTP requests, variables, control flow, reusable functions, and a key-value
store to the bot's existing actions, conditions, triggers, and placeholders.
The addon source is in `src/addons/Mikting`.

## Quick start

1. Put any API credentials in the environment, for example
   `MIKTING_API_TOKEN=...`. Reference them by name in your script.
2. Write a script using `miktingHttp` and place the next actions under
   `args.follow-up-actions`.
3. Handle failed requests with a condition or `miktingBranch`. Inspect
   `[[mikting_error]]` for the reason.
4. Run `/mikting-status` to check the active store driver, webhook URL, and
   loaded libraries. The command responds privately.

## Actions and follow-ups

Place `follow-up-actions` inside an action's `args`. In this example, the
reply reads the status from the HTTP request:

```yaml theme={null}
- id: miktingHttp
  args:
    url: 'https://postman-echo.com/get'
    follow-up-actions:
      - id: miktingReply
        args: { content: 'status [[mikting_status]]' }
```

Use `not-met-actions` on a condition to handle a false result. It is a
condition field, so it belongs outside `args`:

```yaml theme={null}
conditions:
  - id: miktingHttpOk
    not-met-actions:
      - id: miktingReply
        args: { content: 'API down, logged.' }
```

These fields are defined by ItsMyBot 3.11.0 in
`src/core/services/actions/actionData.ts` and
`src/core/services/conditions/conditionData.ts`.

## Variables and placeholders

Use `[[name]]` to read a script variable and `%name%` to expand a bot
placeholder. Mikting also provides placeholders with the `%mikting_*%`
prefix; existing placeholder names continue to work.

The engine types variables as `string | number | boolean | null`. Mikting
also stores arrays and objects in them at runtime, such as a page of API
results. Use `miktingArray` with `join` or `miktingJson` with `stringify` or
`query` when you need to format those values as text.

## Script validation

ItsMyBot validates action arguments with
`whitelist: true, forbidNonWhitelisted: true`. Unknown argument names are
rejected. Use the documented fields for each action.

Mikting action and condition IDs start with `mikting` or `isMikting`.
Its emitted trigger names also start with `mikting`. These names are
separate from the core IDs. Code emits a custom trigger through
`manager.services.engine.event.emit(name, context, variables)`; addons do
not use a `triggers/` folder.

## Guides and reference

* [Actions](https://mikting.docs.komo.moe/actions.md): arguments and outputs for each action.
* [Conditions](https://mikting.docs.komo.moe/conditions.md): boolean checks and failure actions.
* [Triggers and placeholders](https://mikting.docs.komo.moe/triggers-and-placeholders.md): event names
  and values available to scripts.
* [Key-value store](https://mikting.docs.komo.moe/key-value-store.md): scopes, expiration, and persistent data.
* [Secrets](https://mikting.docs.komo.moe/secrets.md): environment variables and numbered API keys.
* [HTTP and webhooks](https://mikting.docs.komo.moe/http-and-webhooks.md): requests, responses, and
  inbound hooks.
* [External APIs](https://mikting.docs.komo.moe/external-apis.md): request and response examples.
* [Libraries](https://mikting.docs.komo.moe/libraries.md): reusable YAML functions.
* [Debug checks](https://mikting.docs.komo.moe/debug-checks.md): private checks through `/mikting-debug`.
* [Examples](https://mikting.docs.komo.moe/examples.md): scripts you can copy into your configuration.
* [Security and Pterodactyl](https://mikting.docs.komo.moe/security-and-pterodactyl.md): networking,
  logging, and persistent storage.

[Documentation home](https://mikting.docs.komo.moe/index.md) · [Source Markdown](https://gitlab.com/komomori/mikting/-/blob/main/docs/mikting-overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.