Skip to main content
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:
Use not-met-actions on a condition to handle a false result. It is a condition field, so it belongs outside args:
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

Documentation home · Source Markdown