Skip to main content
The examples/ directory contains complete scripts. Copy a file to configs/Mikting/scripts/ (or the folder selected by scripts.dir), then reload the addon. These examples use follow-up-actions for work after an action and not-met-actions for a false condition.

Count messages

examples/kv-counter.yml keeps a per-user message count in the persistent store and runs a branch at a milestone. See Key-value store for scopes and expiration.

Read a JSON response

examples/http-get.yml sends a GET request with a query string, then replies with echo_json_args_hello. It branches on the HTTP status so the script can handle failures.

Receive a webhook

examples/webhook-relay.yml handles an inbound webhook and reacts to the message. A local request can be sent with: curl -X POST localhost:3000/mikting/hooks/deploys -d '{"repo":"x"}' Set MIKTING_HOOK_DEPLOYS to require a signature. See HTTP and webhooks for signing details.

Assign a role after a poll

examples/poll-vote-role.yml uses miktingPollVote and gives a role to the voter.

Branch on an API result

examples/api-flag-gate.yml authenticates with MIKTING_API_TOKEN, checks a JSON flag, and deletes a message when the result is true. It skips bots. Read External APIs before using the pattern with a real provider. Documentation home · Source Markdown