OneBot
| Schemes | onebot://, onebots:// |
| Cargo feature | service-onebot |
| Service | https://github.com/botuniverse/onebot-11 |
| Body formats | text (first is the default) |
| Attachments | yes |
| Title length | no title (merged into the body) |
| Body length | 4,500 characters |
| Body lines | unlimited |
| Request throttle | none |
| Vendor URLs accepted | no |
URL formats
{schema}://{host}/{targets}
{schema}://{host}:{port}/{targets}
{schema}://{token}@{host}/{targets}
{schema}://{token}@{host}:{port}/{targets}
{schema} is one of onebot://, onebots://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{host} | Hostname | string | yes | ||
{port} | Port | int, 1 to 65535 | no | ||
{target_group} | Target Group ID | string | no | prefix #; must match ^[0-9]{1,19}$ | |
{target_user} | Target User ID | string | no | prefix @; must match ^[0-9]{1,19}$ | |
{targets} | Targets | list | no | any of target_group, target_user; separated by / | |
{token} | Access Token | string | no | secret |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
to | Targets | list | sets {targets} | |
token | Access Token | string | sets {token} |
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Accepted URLs (tokens are fake):
onebot://localhost/12345
onebot://localhost/1/%232
onebot://localhost:3000/@12345/%2367890
onebots://tok%20en@localhost:5700/@12345/%23678
onebot://localhost/abc/12345/11111111111111111111
onebot://localhost/12345?token=abc
onebot://localhost/?to=%23999,222,111
Rejected URLs:
onebot://
Send one from the command line:
mercurio -t 'Backup' -b 'Finished in 42s' 'onebot://localhost/12345'
Notes
OneBot 11 HTTP API (onebot://, onebots://): messages through a OneBot 11 HTTP API server.