Adapted from the official ShiritaiBot documentation.
Contents
Getting started
Quick start
Run ShiritaiBot from source and connect your first model.
One-click setup
Install Git, then run the command for your operating system.
Windows PowerShell
git clone https://github.com/ShiritaiBot-Devs/ShiritaiBot.git
cd ShiritaiBot
powershell -NoProfile -ExecutionPolicy Bypass -File scripts/install.ps1
macOS / Linux
git clone https://github.com/ShiritaiBot-Devs/ShiritaiBot.git
cd ShiritaiBot
bash scripts/install.sh
Prerequisites for manual setup
Install these tools on Linux, macOS, or Windows.
- Python 3.12+
- uv to install dependencies and run the service
- Node.js and npm to build the admin dashboard. Node.js 24 is recommended.
- Git
Download and run
Open a terminal in the directory where you want to keep the project. These commands work in Bash, zsh, and PowerShell. If PowerShell blocks npm.ps1, use npm.cmd in place of npm in both build commands.
git clone https://github.com/ShiritaiBot-Devs/ShiritaiBot.git
cd ShiritaiBot
uv sync
npm --prefix web ci
npm --prefix web run build
uv run shiritaibot run
To access the dashboard through a reverse proxy, use
--allowed-hostin the startup command to allow the proxy hostname. The service still listens on the local machine.uv run shiritaibot run --allowed-host shiritai.example.com
Sign in to the dashboard
Once the service starts, open the full URL after Uvicorn running on in the terminal to sign in. If you open http://127.0.0.1:8765 directly, enter the admin token on the sign-in page.
If you installed manually, open a new terminal in the same ShiritaiBot project directory you started the service from, then run the following command.
uv run shiritaibot token
If you set --home on startup, pass the same path when you retrieve the token. If you used the one-click installer, run the token command it prints at the end. Paste the token into the sign-in page.
Next steps
- Configure models and routing
- Connect QQ via NapCat
- Connect Feishu or Lark
- Learn how proactive events and tools work
- Write your first plugin
Models and services
Connect multiple providers to one agent and choose the right model for each task.
Add a provider
Go to Models and Services in the dashboard and add a provider. Select an API protocol, then enter the service URL and API key. ShiritaiBot encrypts the key when you save. The form shows that a key is configured when you reopen it.
Add a language model provider
ShiritaiBot currently supports OpenAI Chat Completions, OpenAI Responses, Anthropic, and Google Gemini API formats. More protocols are planned.
| Protocol | Example endpoint |
|---|---|
| Chat Completions | https://api.openai.com/v1 |
| Responses | https://api.openai.com/v1 |
| Anthropic | https://api.anthropic.com/v1 |
| Gemini | https://generativelanguage.googleapis.com/v1beta |
The provider form also accepts proxy settings, timeouts, and extra request parameters.
Add an embedding provider
Embedding models turn long-term memories into vectors. Configuring one can make memory retrieval more accurate.
ShiritaiBot supports providers that offer an OpenAI- or Gemini-compatible embedding API.
Add a decision model provider
ShiritaiBot uses fast, inexpensive decision models such as TypeSafe's Jev throughout the runtime. They route agent requests to Work or Chat, approve tool calls, decide when to insert or write memories, and assess how important a memory is. They run faster and at a lower cost than general-purpose models, and can handle semantic judgments that rules alone struggle to make. We strongly recommend configuring at least one.
ShiritaiBot can connect to decision models that support the SystemOne protocol.
Add and test a model
Click Fetch provider models, then click + beside the model you want. You can also enter a model name manually.
Test current configuration sends a real request to the model. Save once the test succeeds.
Assign models to routes
After adding and testing a model, assign it to a route so each task can use an appropriate model.
The language model routes include an option for Agent Work/Chat routing. When enabled, ShiritaiBot classifies each new message in Agent mode as Work (long-running tasks) or Chat (everyday conversation) and selects a model accordingly. With routing disabled, Agent mode uses the Agent Work model by default.
| Route | Purpose | Suitable models |
|---|---|---|
| Default Chat model | Responds in Chat-mode conversations, such as group chats | Fast, lightweight models that chat naturally in Chinese, such as gemini-3.5-flash-lite |
| Agent Work model | Plans and executes long-running, tool-based tasks in Agent mode | Models that call tools reliably and can sustain work over many steps, such as gpt-6.1-sol |
| Work/Chat routing model | Classifies new Agent-mode messages as Work or Chat | A decision model such as Jev, or a small model with high throughput, such as gemma-4-31b-it |
| Proactive event triage and summarization model | Handles lightweight tasks such as ranking events and summarizing short-term memory | A decision model such as Jev or a small model with high throughput. If you use Jev, add a text model to generate memory summaries. |
| Memory model | Makes decisions about how to organize memories | A decision model such as Jev, or a reasonably priced text model that understands Chinese well and produces consistent JSON. A fallback text model is recommended. |
| Automatic tool approval model | Approves or denies calls to tools set to Model approval | A text model that makes careful decisions and produces consistent JSON. You can list a decision model such as Jev first and accept its decision only when confidence is high. Otherwise, the system falls back to the text model. |
| Image description model | Describes images in the context as text when the primary model cannot process them | A low-cost multimodal model with reliable vision capabilities, such as glm-5.3-flash |
| Embedding model | Computes vectors for memory entries and queries to support semantic search | An embedding model. The first available model is used. |
Test the connection
Open the chat panel, send a message, and check ShiritaiBot's reply.
If it replies normally, your model is ready. Connect ShiritaiBot to a messaging platform to keep chatting when you're away from the dashboard.
Connect QQ
Use the agent in your existing QQ chats over a OneBot V11 forward WebSocket connection.
ShiritaiBot connects to QQ through OneBot V11. The steps below use NapCat, though SnowLuma also works. For Feishu, see Connect Feishu or Lark.
Set up NapCat
Follow the NapCat documentation to install it and sign in to the bot account. In the network settings, enable forward WebSocket and set the listening address and access token.
Add a protocol connection
In the ShiritaiBot dashboard, go to Protocol Connections → Add, select QQ · OneBot V11, and click Continue. Enter the connection details.
- The universal WebSocket URL, such as
ws://127.0.0.1:3001. - The bot's QQ account and the owner's QQ account.
- The same access token you set in NapCat.
Turn on Enable connection, click Save and apply, and check the connection status on the overview page. Then send /help from the owner's QQ account and confirm the bot replies with the help menu.
Connect Feishu or Lark
Add a Feishu app bot for direct messages and keyword activation in group chats.
One ShiritaiBot instance can connect to QQ and one Feishu bot at the same time. See the official Feishu bot documentation for details on creating an app bot.
You can create the bot by scanning a QR code or connect an existing app manually.
Create a bot with a QR code
- In Protocol Connections, click Add, select Feishu App Bot, then choose Create with QR code.
- Select Feishu or Lark, depending on the app you use, and click Generate QR code. Scan it with the corresponding mobile app and confirm creation.
- In the dashboard, select a memory database and click Save and connect. ShiritaiBot saves the app credentials automatically.
If you already have a Feishu connection, you can save the new bot with the connection disabled until you're ready to switch.
If the mobile app created the bot but no instance appears in the dashboard, connect the app with the manual setup below.
Connect an app manually
- Open the app in the Feishu Open Platform or Lark Developer Console. Under Credentials and Basic Information, copy the App ID and App Secret. If you haven't created an app, first create a custom app for your organization and add the bot capability.
- In the ShiritaiBot dashboard, go to Protocol Connections → Add, select Feishu App Bot, and choose Manual setup.
- Select the platform, enter the App ID and App Secret, enable the connection, and save.
If Feishu does not appear in the list, update to the latest code from main and rebuild the dashboard.
Publish the app and subscribe to events
Complete these settings for a manually created app. If a QR-created app is awaiting publication or approval, or the bot isn't receiving messages, check the same settings.
- In Permissions on the open platform, enable
im:message.p2p_msg:readonlyto receive direct messages andim:message:send_as_botto send messages. - In Events and Callbacks, select Receive events over a persistent connection and subscribe to
im.message.receive_v1. If Feishu reports that the connection hasn't been established, enable the instance in ShiritaiBot, then return and save. See the Feishu persistent connection guide for details. - Publish the app and add the accounts that need to use the bot to its availability scope. If it requires approval, wait for an administrator to approve it before testing.
Set the owner
Send the bot a text message from the account you want to use as the owner. In the dashboard's Feishu instance settings, check the most recent sender's ou_… ID, enter it under Owner Open ID, and save. Send another message and confirm that the bot replies.
Wake the bot in a group chat
- Request
im:message.group_msgon the open platform. Once the permission is approved and the app is published, add the bot to a test group. This permission delivers group messages even when they do not@mention the bot. - In the Feishu instance's Allowed group chats setting, enter one
oc_…group ID per line. You can look up IDs with the Feishu group chat API. - Save, then send a message beginning with the wake word in the group. Check that the bot replies.
To let the bot take recent group messages into account, enable Record Feishu group chat context.
Memory database
By default, Feishu direct messages use a separate Feishu memory database. To share memory with QQ and the web UI, select Use existing default memory database in the Feishu instance settings.
Permissions
Control what ShiritaiBot can do in each conversation.
ShiritaiBot isolates sessions and lets you configure permissions under Tools and Permissions in the sidebar.
There are two conversation modes.
- Chat is intended for everyday conversation. Subject to the permissions you set, the model can call basic tools such as checking the time, searching the web, or looking up recent group chat context. This mode works well for group chats.
- Agent lets the model call the tools listed below, subject to your permissions. It is recommended for the web UI, the owner's sessions, and Proactive Loop.
You can configure built-in tool permissions per conversation. Use the scope selector to set permissions for a specific session or defaults for owner and web UI sessions, other direct and group chats, and Proactive Loop.
ShiritaiBot offers the following presets.
- Require human approval for all tools.
- Allow safe tools and require human approval for the rest.
- Allow safe tools and use the configured approval model for the rest.
- Allow all tools without approval.
In Agent mode, ShiritaiBot can run shell commands directly on the host. Use full access with care, or set a separate approval policy for shell access.
The Approval and Execution Settings card lets you tune automatic tool approvals and agent execution.
Configure subagents
Let ShiritaiBot work with coding agents on your computer.
ShiritaiBot includes tools to manage Codex and Claude Code sessions. More coding agents may be added in the future. Add a subagent instance under Subagents in the web UI sidebar.
Once you enable a subagent and allow ShiritaiBot to use its tools, it can delegate more complex or longer-running work to a local Codex or Claude Code instance. When the work finishes, Proactive Loop processes the result and sends it back to you.
Other settings
Use Settings in the sidebar to configure the rest of ShiritaiBot.
General
Set the default persona (the system prompt) and how many LLM requests can run concurrently.
Web search
Choose a provider for the web search tool. ShiritaiBot supports Tavily, SerpAPI, and DeepSeek web search.
Merge consecutive messages
When enabled, ShiritaiBot groups consecutive messages from the same sender by time to reduce the number of model calls. This feature is still being refined.
Names and wake words
Set the bot's name and how it addresses the owner.
Personas
Configure bot personas. In chat, use /personas to see the list and /persona to switch.
Context management
Configure how ShiritaiBot manages conversation context.
Long-term memory
Enable and customize long-term memory features.
Group chat context
Let ShiritaiBot take the preceding discussion into account when it is called on in a group chat.
Proactive behavior and notifications
Enable ShiritaiBot's proactive features here.
How the framework works
Design principles
Both conversations and external events can start work. They use the same tools to get it done.
Work in progress.
Everywhere Agent
A typical agent workflow starts when you sit down at a computer and type a prompt. The agent does the work, and you come back to check the result. That saves time writing code, but you still have to be at your computer to get things started.
ShiritaiBot aims to take this a step further. You can get work done from anywhere through the apps you already use every day.
Proactive Loop
Alongside the Main Loop for conversation, ShiritaiBot has an event-driven Proactive Loop.
A new message from an event source activates the Proactive Engine, and a decision model evaluates its importance. Low-importance events are discarded. Medium-importance events are summarized or organized and filed. High-importance events are processed and sent straight to the user.
Our goal is for ShiritaiBot to take care of the groundwork before you have to ask.
Tools for Everything
ShiritaiBot aims to make as much functionality as possible available through tools, with skills as a future direction. The idea is to do more in plain conversation, even when maintaining or updating ShiritaiBot itself.
Self-improvement
We want ShiritaiBot to help with work and be a companion you can talk to throughout the day. Over time, it can remember details about you and adapt to your habits at work and in everyday life.
Memory layer
The memory layer connects people, facts, and events, then brings them back into the conversation with their sources when relevant.
Work in progress.
What it remembers
People and things are stored as entities, and aliases link their different names. Facts describe a state and when it was valid. Events record what happened and its absolute timestamp. Source excerpts tie facts and events back to the evidence they came from.
Short-term memory keeps model-generated summaries from the past seven days so work can pick up where it left off. Long-term memory lives in SQLite and is separate from the conversation context.
How memory stays current
When a private conversation with the owner reaches the window size or has been idle for a while, the core runtime reads the completed conversation and organizes the memories. Completed proactive events go through the same process.
A new state can supersede an old fact, while the old entry remains in the history. When equally reliable sources disagree, the system keeps both records and the agent asks you to clarify when the topic comes up.
How relevant memories are retrieved
Retrieval combines name matching, BM25 keyword search with jieba, and optional semantic search with embeddings. It merges the results using reciprocal rank fusion (RRF). Matches that pass the threshold are injected into the conversation in separate groups for people, things, and events.
Assign the memory and embedding routes in Models and Services. In Settings, you can toggle memory injection and set its budget. Private memories are available in the owner's Agent and Proactive sessions.
Manage memories in conversation
Ask the agent to remember something, forget a record, or treat two names as the same person. It uses the appropriate tools for each request. You can browse records and inspect their sources in the dashboard.
Tools
memory_search 检索相关记忆
memory_get 回看详情与原文证据
memory_save 写入或更正事实与事件
memory_forget 按要求遗忘
memory_resolve 记录冲突的确认结果
Plugin development
Your first plugin
Start with Hello World and write your first ShiritaiBot plugin.
Plugins can add commands, expose new tools to models, send external events such as email and notifications to the Proactive Engine, and intervene at different stages of model requests and outgoing messages.
This chapter walks through building a plugin from scratch. Prepare the following before you start.
- Be comfortable with Python and the basics of
asyncandawait. - Follow the quick start to run ShiritaiBot and configure at least one model.
ShiritaiBot's plugin API draws on the AstrBot plugin API, so the basic structure is similar. If you have written an AstrBot plugin, much of this will feel familiar.
Plugin directory
On startup, ShiritaiBot scans every subdirectory of <data-dir>/plugins/. Each subdirectory is one plugin. The data directory defaults to data under the directory where you started ShiritaiBot, unless you override it with --home.
The directory name is the plugin ID. Use lowercase letters, digits, and underscores, as in hello_world or weather_cn. The ID appears in configuration files, logs, and data paths, so keep it stable once you choose it.
We recommend naming your plugin srtb_plugin_<plugin_name>, for example srtb_plugin_wechat.
A plugin needs at least two files.
Directory structure
data/plugins/hello_world/
├── metadata.yaml # 插件信息(必需)
├── main.py # 插件入口(必需)
└── _conf_schema.json # 配置项定义(可选)
Write metadata.yaml
metadata.yaml describes the plugin, including its name and author.
metadata.yaml
name: hello_world
display_name: Hello World
desc: 我的第一个 ShiritaiBot 插件
short_desc: 打个招呼
version: 1.0.0
author: your-name
repo: https://github.com/your-name/hello_world
| Field | Description |
|---|---|
name | Plugin name. The directory name is always the plugin ID. This field is displayed when display_name is absent. |
display_name | Name shown in the plugin list. |
desc | Full description. |
short_desc | One-line description. |
version / author / repo | Version, author, and repository URL shown in the plugin details. |
support_platforms | Optional list of supported platforms. Accepts qq and web and is used for display only. |
shiritaibot_version | Optional supported ShiritaiBot version range, such as ">=0.2,<1". The plugin is marked as failed to load if the version does not match. |
Write main.py
In main.py, define a class that inherits from Plugin. You can choose any class name. Each main.py can contain only one plugin class.
main.py
from shiritaibot.api import MessageEvent, Plugin, hook
class HelloWorld(Plugin):
async def initialize(self):
self.logger.log("Hello World 插件已启动")
@hook.command("hello")
async def hello(self, event: MessageEvent, name: str = ""):
"""打个招呼"""
yield event.plain_result(f"你好,{name or event.get_sender_name()}!")
The example handles initialization and registers a command.
- ShiritaiBot calls
initialize()when it loads the plugin. Here it only writes a log entry. @hook.command("hello")registers the/hellocommand. When a user sends/helloor/hello 小明, ShiritaiBot callshello()and extracts thenameargument from the message. The function's docstring appears in/help.
Import everything the plugin needs from shiritaibot.api. Other ShiritaiBot modules are internal and may change at any time, so avoid importing them directly.
Load and debug a plugin
- Put the plugin directory in
data/plugins/. - Open Plugins in the dashboard and click Reload plugins. ShiritaiBot rescans the plugin directory, and your plugin should appear in the list.
- New plugins are disabled by default. Open the plugin, turn on Enable plugin, and save.
- Send
/helloin the chat panel or in QQ and check that the bot replies.
After changing the code, choose Reload this plugin in its settings to use the new code without restarting ShiritaiBot. If the new code has an error, the previous version keeps running and the plugin list shows the error. Fix it and reload again.
Plugin logs written through self.logger appear in the terminal and under Logs → Runtime logs in the dashboard. Start there when troubleshooting.
Use relative imports to access other .py files in the plugin directory, for example from .utils import parse_city. They are refreshed when you reload the plugin.
Lifecycle
A plugin class has two lifecycle methods you can override.
main.py
import asyncio
from shiritaibot.api import Context, Plugin, PluginSettings
class MyPlugin(Plugin):
def __init__(self, context: Context, config: PluginSettings):
super().__init__(context, config)
self.task = None
async def initialize(self):
# 插件加载时调用,适合建立连接、启动后台任务
self.task = asyncio.create_task(self.poll())
async def terminate(self):
# 插件停用、重载、移除或 ShiritaiBot 退出时调用
if self.task:
self.task.cancel()
async def poll(self):
...
Saving configuration or clicking reload reloads the plugin. ShiritaiBot calls terminate() on the old instance before creating a new one. Stop any background tasks and close any connections created in initialize() from terminate() to avoid leaving duplicates after a reload.
__init__ is optional. If you define it, remember to call super().__init__(). If your plugin needs no configuration, __init__ can accept just context.
The following properties are available on a plugin instance.
| Property | Description |
|---|---|
self.config | Plugin configuration. See Plugin configuration. |
self.context | Services provided by the host. See Host services. |
self.logger | Logger. |
self.data_dir | The plugin's data directory, data/plugin_data/<plugin ID>/. It is kept when the plugin is removed. |
self.name | Plugin ID. |
Third-party dependencies
ShiritaiBot does not install plugin dependencies automatically. If a plugin uses third-party libraries, put a requirements.txt in its directory and document the installation in the README. Here is an example to run from the ShiritaiBot directory.
uv pip install -r data/plugins/hello_world/requirements.txt
Dependencies installed this way are kept when you update ShiritaiBot through the dashboard. If you run uv sync manually from the command line, use --inexact to keep them.
ShiritaiBot includes common libraries such as httpx, pydantic, and pyyaml. Prefer the libraries already available when they fit. ShiritaiBot may add automatic dependency checks in the future. For now, use the steps above.
Distribute a plugin
Other ShiritaiBot users can install your plugin in three ways.
- Publish it in a public GitHub repository. Users enter the repository URL under Plugins → Install plugin, and ShiritaiBot downloads the default branch.
- Package it as a ZIP for upload in the same screen. The archive can contain the plugin files directly or place them in a single enclosing directory.
- Copy the directory into
data/plugins/manually, then click Reload plugins.
When installing, users supply the plugin ID, which becomes the installed directory name. Installed plugins are disabled by default. Users can fill in the configuration and enable the plugin when ready.
Development guidelines
Plugins run in the ShiritaiBot process with the same system permissions and no sandbox.
- Keep the event loop responsive. Use asynchronous clients such as
httpx.AsyncClientfor network requests. Run unavoidable synchronous calls inasyncio.to_thread(). A synchronous call such astime.sleep()blocks the whole bot. - Clean up after your plugin. Stop the tasks and close the connections you start in
initialize()fromterminate(). - Protect user credentials. Store passwords and tokens in
secretconfiguration fields. Keep them out of logs and model responses. - Declare the tool's actual risk level. Tools that write data or have external effects should use a level other than
safe. See Risk levels. - Treat external content as untrusted. Email, webpages, and issues may contain instructions aimed at the model. Consider what you pass to the model.
The ShiritaiBot developers do not guarantee the safety of plugins installed from the Internet.
Next steps
- Commands and messages covers registering commands and listening for group messages.
- LLM tools shows how to give the model a new tool.
- Plugin configuration lets users configure a plugin through the dashboard.
- Agent and send hooks covers modifying model requests and outgoing messages.
- Proactive events covers sending external events to the Proactive Engine.
- Host services covers sending messages, calling models, and storing data.
The complete hello_world example plugin uses most of the features in this chapter. Copy it if you want a working reference.
Commands and messages
Register slash commands or listen for every incoming message.
A plugin can handle messages in two ways.
- Commands run when a user sends
/command arguments. Use them for explicit actions, such as/weather 北京. - Message listeners receive incoming messages. Use them for features such as keyword replies or statistics.
Both run before the message is passed to the model. A plugin can handle the message itself and stop it from reaching the model.
Register a command
main.py
from shiritaibot.api import MessageEvent, Plugin, hook
class Weather(Plugin):
@hook.command("weather", aliases={"天气"})
async def weather(self, event: MessageEvent, city: str):
"""查询天气:/weather 城市"""
yield event.plain_result(f"{city}今天晴。")
Use aliases to set alternate names. In the example, both /weather 北京 and /天气 北京 trigger the command.
The first line of the triple-quoted docstring appears in /help. Use it to explain how to run the command.
Command arguments
ShiritaiBot splits the text after a command on spaces and assigns it to the handler's parameters in order, starting after self and event. Type annotations determine how the values are parsed.
| Annotation | Conversion |
|---|---|
str or no annotation | Passed through as text. |
int / float | Converted to a number. |
bool | true, yes, on, 1, 是, and 开 are true. false, no, off, 0, 否, and 关 are false. |
- Parameters without defaults are required. If a parameter is missing or cannot be converted to the expected type, ShiritaiBot replies with usage information, such as
用法:/weather <city>. - The last
strparameter receives all remaining text. For example, with/note 明天 记得 交作业, thetextinasync def note(self, event, text: str)is明天 记得 交作业. Use*argsto collect the remaining arguments as separate values. - Quote arguments that contain spaces, as in
/remind "下午 3 点" 开会.
main.py
@hook.command("add")
async def add(self, event: MessageEvent, a: int, b: int):
"""两数相加:/add 1 2"""
return event.plain_result(str(a + b))
@hook.command("sum")
async def total(self, event: MessageEvent, *numbers: float):
"""求和:/sum 1 2 3 ..."""
return event.plain_result(str(sum(numbers)))
Command groups
When a plugin offers several related commands, put them in a group. Users run them with /group subcommand arguments.
main.py
@hook.command_group("todo")
def todo(self):
"""待办事项"""
@todo.command("add")
async def todo_add(self, event: MessageEvent, text: str):
"""添加待办:/todo add 内容"""
...
@todo.command("list")
async def todo_list(self, event: MessageEvent):
"""列出待办:/todo list"""
...
Sending just /todo lists the subcommands in the group. Command groups can be nested by creating a subgroup, for example with todo.group("sub").
Reply to a message
A handler can reply in three ways. Each sends a plain-text message to the conversation that triggered the command.
main.py
# 1. yield,可以多次 yield 发多条消息
yield event.plain_result("第一条")
yield event.plain_result("第二条")
# 2. return 一条结果,也可以直接 return 字符串
return "处理完成"
# 3. 在任意位置主动发送
await event.send("正在查询,请稍候…")
Commands run in the background for up to 10 minutes. The bot keeps handling other messages in the meantime. Commands and replies are stored in the conversation history and kept out of the model's context.
Raise PublicError to reply directly to the user with the error message for an expected problem, such as a city name the plugin does not recognize. For other exceptions, the user sees a generic plugin command failure message and the full traceback goes to the logs.
main.py
from shiritaibot.api import PublicError
if city not in CITIES:
raise PublicError(f"没有找到城市「{city}」")
Replies currently support plain text. Rich messages such as images are not yet supported.
Restrict where a command can run
Stack any of the following decorators with @hook.command to control when a command is available.
main.py
from shiritaibot.api import MessageType, Permission, Platform, hook
@hook.permission(Permission.OWNER) # 只有主人能用,其他人会收到提示
@hook.message_type(MessageType.PRIVATE) # 只在私聊中生效
@hook.platform(Platform.QQ) # 只在 QQ 上生效
@hook.command("reset")
async def reset(self, event: MessageEvent):
...
| Decorator | Available values |
|---|---|
@hook.permission(...) | Permission.OWNER, Permission.EVERYONE |
@hook.message_type(...) | MessageType.PRIVATE, MessageType.GROUP, MessageType.ALL |
@hook.platform(...) | Platform.QQ, Platform.WEB, Platform.ALL |
Listen for messages
Use @hook.message_type or @hook.regex to listen for ordinary messages without a leading /.
main.py
@hook.regex(r"^ping$")
async def ping(self, event: MessageEvent):
await event.send("pong")
event.stop_event() # 不再交给其他插件和模型
@hook.message_type(MessageType.GROUP)
async def count(self, event: MessageEvent):
total = await self.get_kv_data(event.group_id, 0)
await self.put_kv_data(event.group_id, total + 1)
@hook.message_type(...)receives every message of the selected type.@hook.regex(pattern)runs only when the message text matches the regular expression.
Calling event.stop_event() prevents later listeners from running and keeps the message from reaching the model. Otherwise the message is passed to the model as usual.
Listeners still receive group messages that neither mention the bot nor contain a wake word. For these messages, event.is_wake is False. They do not reach the model anyway, which makes them suitable for statistics or keyword triggers.
Listeners run from highest to lowest priority, defaulting to 0. Set it in the decorator, for example @hook.regex(r"^ping$", priority=10). A listener can run for up to 30 seconds. Move longer work to a background task.
Message events
Handlers receive a MessageEvent as event. The following fields are commonly used.
| Field | Description |
|---|---|
text | Plain text entered by the user. |
session | Session ID, such as private:qq:12345. Pass it to self.context.send_message() to send to that session. |
sender_id | Sender ID. |
get_sender_name() | The sender's nickname, falling back to their ID. |
platform | qq or web. |
group_id | Group ID, or an empty string in direct messages. |
is_group / is_private | Whether this is a group chat or direct message. |
is_owner | Whether the sender is the owner. |
is_wake | Whether the message wakes the bot. |
message_id | Message ID. |
segments | OneBot message segments, including images and @ mentions. |
raw | Original event from the protocol adapter. |
Changing these fields does not change what the model sees. To add information to the model input, use on_llm_request.
Command restrictions
- Plugin commands must have unique names. A name shared with a built-in command such as
/help,/status, or/stop, or a command from another plugin, prevents the plugin from loading. - ShiritaiBot handles built-in commands, stop and cancel replies such as “停” and “取消,” and tool approval replies itself. They are not passed to plugins.
LLM tools
Let a model call functions from your plugin.
Users enter commands explicitly. A model can choose to call a tool on its own. If someone asks whether it will rain in Beijing tomorrow, the model can call your weather tool and use its result to answer.
“Tools for Everything” is one of ShiritaiBot's design principles. Tools let the model do more from a request written in plain language.
Register a tool
Decorate a method with @hook.llm_tool.
main.py
from shiritaibot.api import Plugin, ToolContext, hook
class Weather(Plugin):
@hook.llm_tool("weather_query", risk="safe", chat=True)
async def weather_query(self, ctx: ToolContext, city: str, days: int = 1):
"""查询城市未来几天的天气预报。
Args:
city(string): 城市名,例如"北京"
days(integer): 查询天数,1 到 7
"""
forecast = await self.fetch(city, days)
return {"city": city, "forecast": forecast}
- The first argument is the tool name the model uses to call it. Tool names must be unique across plugins. Prefix the name with your plugin's name to avoid collisions. If omitted, it defaults to the method name.
- The part of the docstring before
Args:tells the model what the tool does and when to call it. TheArgs:section describes its parameters. riskis the required risk level, described below.ctxis the context of this call. The model supplies the parameters that follow it.
Define parameters
ShiritaiBot determines tool parameters in this order.
- The docstring's
Args:section is recommended. Write each line asname(type): description. Supported types includestring,number,integer,boolean,object, andarray. Use a form such asarray[string]to specify the element type. - Type annotations. Without
Args:, ShiritaiBot generates parameters from annotations such asstr,int,float,bool,list, anddict. The model may struggle to use them without descriptions. - An explicit schema. Pass a JSON Schema when you need constraints such as enums or length limits.
main.py
@hook.llm_tool(
"note_save",
risk="normal",
description="保存一条笔记",
parameters={
"type": "object",
"properties": {
"title": {"type": "string", "maxLength": 100},
"tag": {"type": "string", "enum": ["工作", "生活", "学习"]},
},
"required": ["title"],
"additionalProperties": False,
},
)
async def note_save(self, ctx: ToolContext, title: str, tag: str = "生活"):
...
Parameters without defaults are required. ShiritaiBot validates the model's arguments against the definition before calling the tool. If validation fails, the model receives an error and the tool does not run.
Risk levels
Every tool declares a risk level so ShiritaiBot can set its default permissions.
| Level | When to use it | Examples |
|---|---|---|
safe | Read-only operations with no side effects | Check the weather, search, list files |
normal | Writes with a limited, reversible impact | Save a note, create an issue |
sensitive | External effects or actions that are hard to undo | Send email, merge a PR, push code |
dangerous | Actions that could have serious consequences | Change repository settings, delete data |
Risk levels set the default for each tool in the permission presets. In the dashboard, users can block an individual tool, require human approval, use a model to approve it, or allow it without approval.
Declare the tool's actual risk. An email tool marked as safe could send mail without the user's knowledge. If you're unsure, choose sensitive so it requires approval by default and users can adjust the permission themselves.
Use a tool in Chat mode
Plugin tools are available to the model in Agent mode by default. You can set chat=True to make a read-only tool for everyday tasks, such as checking the weather, available in Chat mode as well, including in group chats.
Tool call context
ctx is a ToolContext. Use it to see who called the tool and where the call came from.
| Field | Description |
|---|---|
session | Session ID. |
actor | User who started the turn. |
owner | Whether the actor is the owner. |
group | Whether the call is in a group chat. |
background | Whether the call is part of background work such as handling a proactive event. |
mode | chat or agent. |
For example, you can restrict a tool to the owner's direct messages.
main.py
if not ctx.owner or ctx.group:
raise PublicError("这个工具只能由主人在私聊中使用")
Return values and errors
A tool can return a string, number, dictionary, or list. ShiritaiBot converts it to JSON and passes it to the model. The result becomes part of the model's context, so return only what it needs. Passing an entire API response wastes tokens and makes the logs hard to read.
Raise PublicError to pass a message to the model as written, so it can revise its arguments or explain the problem to the user. Other exceptions produce a generic failure message, with details logged internally. This keeps implementation details out of the model's context. Write error messages that give the model enough information to recover without cluttering the context.
Tools can run for up to 60 seconds by default. Set timeout to change the limit, for example @hook.llm_tool("slow_job", risk="normal", timeout=300).
Register tools dynamically
To register a tool conditionally based on plugin configuration, call register_tool() from initialize().
main.py
from shiritaibot.api import Plugin, TEXT, schema
class Notes(Plugin):
async def initialize(self):
if self.config["allow_write"]:
self.context.register_tool(
"note_save",
"保存一条笔记",
schema({"text": TEXT}, required=["text"]),
self.save,
risk="normal",
)
async def save(self, ctx, args):
...
return {"saved": True}
Plugin configuration
Define configuration fields and the dashboard generates a form for them.
Plugins often need values that differ from one setup to another, such as an API key, a polling interval, or a group ID to monitor. Put an _conf_schema.json file in the plugin directory to make those fields appear in the plugin's dashboard settings.
ShiritaiBot uses the same plugin configuration format as AstrBot. If you're porting a plugin from AstrBot, you can reuse its existing JSON structure.
Declare configuration fields
_conf_schema.json
{
"api_key": {
"type": "secret",
"description": "API Key",
"hint": "在天气服务的控制台获取",
"secret": true
},
"default_city": {
"type": "string",
"description": "默认城市",
"default": "北京"
},
"unit": {
"type": "string",
"description": "温度单位",
"options": ["c", "f"],
"labels": ["摄氏度", "华氏度"],
"default": "c"
},
"interval": {
"type": "int",
"description": "刷新间隔(秒)",
"slider": { "min": 60, "max": 3600, "step": 60 },
"default": 600
}
}
Each key names a configuration field, and its value describes the field. The most common properties are type, description, hint, and default. They set the field's type, display label, help text, and default value.
Configuration field types
| Type | Description | Value when default is omitted |
|---|---|---|
string | Single-line text | "" |
text | Multiline text | "" |
int | Integer | 0 |
float | Decimal number | 0.0 |
bool | Toggle | false |
list | List of strings | [] |
object | Group of nested settings defined in items | Defaults of the nested fields |
dict | Free-form key-value pairs | {} |
template_list | List of entries added from templates | [] |
This example defines an object field.
_conf_schema.json
{
"advanced": {
"type": "object",
"description": "高级设置",
"items": {
"retries": { "type": "int", "description": "重试次数", "default": 3 },
"verbose": { "type": "bool", "description": "详细日志" }
}
}
}
Read the retries field with self.config["advanced"]["retries"], as described below.
Common options
| Option | Description |
|---|---|
description | Field label shown in the form. |
hint | Help text below the label. Set "obvious_hint": true to make it more prominent. |
default | Default value. |
options / labels / subtitles | Dropdown values, labels, and descriptions, in the same order. Setting options on a list creates a multi-select field. |
slider | Adds a slider to an int or float field, for example {"min": 0, "max": 10, "step": 1}. |
secret | Marks the field as a secret. See below. |
invisible | Hides the field in the form while keeping its value. Useful for data managed by the plugin itself. |
editor_mode / editor_language | Displays a code editor suitable for input such as JSON or regular expressions. |
minimum / maximum / pattern | Validates numeric ranges and regular expressions. Invalid values prevent the plugin from loading. |
template_schema for dict and templates for template_list work the same way as in AstrBot. The file type is not yet supported.
Read configuration
self.config is a dictionary that combines defaults with the values entered by the user.
main.py
class Weather(Plugin):
async def initialize(self):
self.city = self.config["default_city"]
self.interval = self.config["interval"]
When a user saves settings in the dashboard, the plugin reloads automatically and the new instance receives the latest configuration. Read it in initialize(). You can rely on the reload to pick up future changes.
If a value fails schema validation (for example, it exceeds maximum), the plugin does not load and the plugin list identifies the field.
Secret fields
ShiritaiBot encrypts fields marked "secret": true when saving them and hides their saved values in the dashboard. This option applies to string and list fields.
The plugin receives a reference such as secret:.... Use resolve_secret() to retrieve the actual value.
main.py
async def initialize(self):
self.api_key = await self.context.resolve_secret(self.config["api_key"])
Use the decrypted value only inside the plugin. Keep it out of logs, responses to the model, and subprocess environment variables.
Update configuration in code
A plugin can update and save its own settings.
main.py
self.config["last_sync"] = "2026-11-03T09:00:00+08:00"
await self.config.save_config()
save_config() saves changes without reloading the plugin. The current instance continues using the same self.config object.
For data created during execution that users do not need to view or edit as settings, use key-value storage.
Update the configuration schema
When upgrading a plugin, edit _conf_schema.json. On reload, ShiritaiBot fills in defaults for new fields and removes deleted fields. It preserves user values for the remaining fields.
Agent and send hooks
Run your own logic at different points during model requests, tool calls, and message delivery.
Hooks let ShiritaiBot call a plugin at specific points in its processing pipeline.
Agent lifecycle
ShiritaiBot processes a conversation turn in the following stages.
| Decorator | Handler parameters | When it runs and what it can do |
|---|---|---|
@hook.on_agent_begin() | (turn) | At the start of a turn. |
@hook.on_llm_request() | (turn, request) | Before each model request. You can modify the request. |
@hook.on_llm_response() | (turn, response) | After a model response. You can rewrite the reply text. |
@hook.on_tool_call() | (turn, name, arguments) | Before a tool call. Observe only. |
@hook.on_tool_result() | (turn, name, arguments, result) | After a tool returns. Observe only. |
@hook.on_agent_done() | (turn, result) | At the end of a turn. |
The model can call several tools in a turn, so on_llm_request and on_llm_response may run more than once.
These hooks run for user conversations and proactive events. Internal model calls, such as those for subagents, event triage, or memory organization, bypass these hooks.
Modify model requests
on_llm_request is the most commonly used hook. This example attaches the current weather to the user's message on the first request of each turn.
main.py
from shiritaibot.api import LLMRequest, Plugin, Turn, hook
class WeatherHint(Plugin):
@hook.on_llm_request()
async def add_weather(self, turn: Turn, request: LLMRequest):
if request.step != 0 or turn.background:
return
weather = await self.current_weather()
request.add_context(f"<weather>当前天气:{weather}</weather>")
The request object exposes these fields and methods.
| Field or method | Description |
|---|---|
system_prompt | System prompt. |
messages | List of messages sent to the model. |
tools | List of tools available to the model. |
add_context(text) | Appends text after the latest user message. This is the most common way to add context. |
step | Zero-based index of the model request in this turn. Read-only. |
route | Model route used for this request. Read-only. |
Changes apply only to that request and are kept out of the conversation history. Add them again for each request that needs them.
Rewrite model replies
main.py
@hook.on_llm_response()
async def polish(self, turn: Turn, response: LLMResponse):
response.text = response.text.replace("我是 AI", "我是 ShiritaiBot")
ShiritaiBot records the rewritten response.text in the history and sends it to the user. response.tool_calls is read-only.
Turn and AgentResult
turn describes the current conversation turn.
| Field | Description |
|---|---|
id | Turn ID. |
session | Session ID. |
actor | User who started the turn. |
owner / group | Whether the actor is the owner and whether the turn is in a group chat, respectively. |
background | Whether this is background work. |
mode | chat or agent. |
text | User input that started the turn. |
proactive | Whether the turn is handling a proactive event. |
event_id | ID of the received proactive event record. Empty for other turns. |
The result passed to on_agent_done contains a status of completed, failed, or cancelled, the number of model requests in steps, and the final reply in text.
Send hooks
Outgoing text to QQ and the dashboard passes through these hooks, including model replies, command output, and proactive notifications.
| Decorator | Handler parameters | When it runs and what it can do |
|---|---|---|
@hook.on_decorating_result() | (message) | Before a message enters the send queue. You can rewrite or cancel it. |
@hook.after_message_sent() | (message) | Runs in the background after a message enters the send queue. |
main.py
from shiritaibot.api import OutgoingMessage
@hook.on_decorating_result()
async def sign(self, message: OutgoingMessage):
if message.session.startswith("web:"):
message.text += "\n\n—— 来自 ShiritaiBot"
@hook.on_decorating_result()
async def block_words(self, message: OutgoingMessage):
if "不该说的话" in message.text:
message.cancel()
Tool approval prompts bypass these hooks. Plugins cannot rewrite or cancel them.
After a plugin loads
A handler decorated with @hook.on_loaded() takes only self. ShiritaiBot calls it after startup or after the plugin reloads. Use it for work that requires other components, such as the QQ protocol adapter, to be ready.
Execution order and time limits
- When several plugins register the same hook, the highest
priorityruns first. Set it with a decorator such as@hook.on_llm_request(priority=10). Ties run in plugin load order, and each plugin sees the object as modified by earlier handlers. - A hook can run for up to 10 seconds. Errors and timeouts log a warning, and normal processing continues.
- Hooks run frequently. Keep them lightweight and cache slow queries ahead of time where possible.
Proactive events
Send changes from outside the conversation, such as emails and notifications, to the Proactive Engine.
ShiritaiBot can act when an email arrives, an assignment is due, or someone opens an issue in a repository. Each of these changes can be sent to the Proactive Engine as an event. The engine assesses the event and decides whether to discard it, organize it, or process it and notify the owner.
Plugins can act as event sources and use hooks to adjust the engine's decisions.
Submit an event
Use self.context.emit() to submit an ExternalEvent.
main.py
from shiritaibot.api import Actor, ExternalEvent
await self.context.emit(
ExternalEvent(
source="weather",
kind="weather.alert",
dedup_key=f"alert:{alert['id']}",
title=f"{city}发布暴雨预警",
payload={"city": city, "level": alert["level"], "text": alert["text"]},
urgency="high",
)
)
| Field | Description |
|---|---|
source | Event source, usually the plugin ID. |
kind | Event kind, such as email.received or weather.alert. |
dedup_key | Required deduplication key. The same key is processed once per source. |
title | One-line title. |
payload | Event details as a JSON-serializable dictionary. |
urgency | One of low, normal, high, or critical. Defaults to normal. This is a hint. The engine determines the final importance. |
occurred_at | A timezone-aware timestamp for when the event occurred. Defaults to the current time. |
actors | People involved, such as the sender of an email. |
Polling plugins often see the same item repeatedly. Use its stable ID as the dedup_key to prevent duplicate notifications.
actors tells ShiritaiBot who was involved, for example Actor(identity="email:someone@example.com", name="张三", role="sender"). After processing the event, ShiritaiBot decides whether to remember those people. The plugin can leave memory writes to ShiritaiBot.
emit() returns a receipt ID when it accepts the event. To see the processing result, call await self.context.get_event(receipt_id). Use emit_many() to submit several events at once.
Write a polling event source
Most event sources check for new items at regular intervals. Start a background task in initialize() and cancel it in terminate().
main.py
import asyncio
import httpx
from shiritaibot.api import ExternalEvent, Plugin
class WeatherAlert(Plugin):
async def initialize(self):
self.task = asyncio.create_task(self.poll())
async def terminate(self):
self.task.cancel()
await asyncio.gather(self.task, return_exceptions=True)
async def poll(self):
async with httpx.AsyncClient(timeout=20) as client:
while True:
try:
await self.check(client)
except Exception as exc:
self.logger.warning(f"检查预警失败({type(exc).__name__})")
await asyncio.sleep(self.config["interval"])
async def check(self, client: httpx.AsyncClient):
city = self.config["city"]
response = await client.get("https://weather.example.com/alerts", params={"city": city})
for alert in response.json()["alerts"]:
await self.context.emit(
ExternalEvent(
source="weather",
kind="weather.alert",
dedup_key=f"alert:{alert['id']}",
title=f"{city}发布{alert['title']}",
payload=alert,
)
)
Catch exceptions inside the polling loop so a single network error does not silently stop the background task.
What happens after submission
- The triage model gives the event an importance score from 0 to 4. Events scored 0 are discarded.
- An event scored 1 or higher starts a Proactive Loop, in which the model can use tools to verify facts and prepare material.
- When the loop finishes, the model decides whether to notify the owner. Events scored 4 always trigger a notification.
The model reads the event content. Emails and webpages can contain instructions aimed at the model. Include only the necessary information in payload.
Adjust the engine's decisions
In addition to submitting their own events, plugins can intervene in the processing of events from other sources.
| Decorator | Handler parameters | When it runs and what it can do |
|---|---|---|
@hook.on_proactive_event() | (event) | When processing starts, before triage. Change title, payload, or urgency, or discard the event with event.drop(reason). |
@hook.on_proactive_judged() | (event, triage) | After triage. Change triage.importance (0 discards the event), decision, message, or reason. |
@hook.on_proactive_done() | (event, outcome) | After the loop and before notification. Rewrite outcome.message or set outcome.notify to False to cancel the notification. |
@hook.on_notification_sent() | (source, text) | After the owner has been notified. Use it to forward the notification to another channel, for example. |
This example ignores events from selected sources.
main.py
from shiritaibot.api import ProactiveEvent, Triage, hook
@hook.on_proactive_event()
async def drop_sources(self, event: ProactiveEvent):
if event.source in self.config["drop_sources"]:
event.drop(f"配置为忽略来源 {event.source}")
@hook.on_proactive_judged()
async def raise_floor(self, event: ProactiveEvent, triage: Triage):
if event.kind == "email.received" and 0 < triage.importance < 2:
triage.importance = 0
Use event.source and event.kind to identify the event. These hooks can run for up to 30 seconds.
ShiritaiBot applies the following rules to protect important events.
- Reminders and scheduled jobs set by the owner, and results from subagents the owner delegated work to, cannot be discarded when
event.protectedisTrue. - Events with importance 4 and owner-set reminders always generate a notification when
outcome.forcedisTrue. Plugins can only change the message. - Invalid modifications, such as an importance score outside 0 to 4 or an empty message, are ignored and logged as warnings.
Notify the owner directly
For a simple notification, call await self.context.notify_owner(text). This bypasses the Proactive Engine's assessment and triage. It also stays out of the short-term memory generated by that engine.
Host services
Send messages, call models, store data, and work with the shell and subagents.
self.context gives plugins access to ShiritaiBot's host services. The methods below are grouped by purpose.
Send messages
await self.context.send_message(session, "提醒:该喝水了")
await self.context.notify_owner("备份失败,请检查磁盘空间")
send_message(session, text)sends text to a specific session. You can keep a session ID fromMessageEvent.sessionorToolContext.sessionfor later use. The message passes through the send hooks.notify_owner(text)sends a notification directly to the owner. It bypasses the Proactive Engine's triage, do-not-disturb rules, and rate limits.
Call a model
Plugins can use a model configured in ShiritaiBot to handle simple text tasks.
summary = await self.context.llm_generate(
f"用一句话总结下面的公告:\n{notice}",
system="你是一个简洁的摘要助手。",
)
| Parameter | Description |
|---|---|
prompt | User message. |
messages | Optional earlier conversation messages. prompt is appended at the end. |
system | System prompt. |
route | Model route. Defaults to light, the route for proactive event triage and summarization. |
The call returns the model's text and provides no tools.
If a decision model is configured, use await self.context.decide(state, questions) to ask structured multiple-choice or scoring questions. If no decision model is set, this returns None. You can fall back to llm_generate.
Store data
Use key-value storage for small amounts of data. Each plugin has its own store, and values must be JSON-serializable.
count = await self.get_kv_data("count", 0)
await self.put_kv_data("count", count + 1)
await self.delete_kv_data("count")
Keep files and larger data in self.data_dir, which points to data/plugin_data/<plugin ID>/. ShiritaiBot creates this directory when it loads the plugin. It keeps the directory when you remove the plugin, so you can access the data again after reinstalling.
Put settings that users need to see or edit in plugin configuration.
Logs
Messages written through self.logger appear in the terminal, in data/logs/shiritaibot.log, and under Logs → Runtime logs in the dashboard. ShiritaiBot adds the plugin ID automatically.
self.logger.debug("只在 --log-level debug 时显示")
self.logger.log("收到 3 封新邮件")
self.logger.warning("收件失败(TimeoutError)", "INBOX") # 第二个参数是额外的标签
self.logger.error("同步出错", exc=exc) # 堆栈会写进日志文件
Write short log messages that people and models can understand. Keep full JSON payloads, message bodies, and credentials out of the logs. Use brief(value, limit) to summarize a dictionary or long string on one line.
from shiritaibot.api import brief
self.logger.log(f"收到请求 {brief(payload, 80)}")
Protocol adapters
Use the adapter to call the OneBot API, for example to list the members of a group.
platform = self.context.get_platform(event.adapter)
if platform and platform.status == "connected":
members = await platform.call("get_group_member_list", {"group_id": int(event.group_id)})
adapter is the ID of the adapter instance, available through MessageEvent.adapter. platform.self_id is the bot's own QQ number.
self.context.get_plugins() returns information about all loaded plugins.
Shell and subagents
ShiritaiBot's shell tool and subagents such as Codex and Claude Code start subprocesses. Plugins can configure those subprocesses with the following methods.
| Method | Description |
|---|---|
set_process_env(env) | Add environment variables to subprocesses, for example to set the Git commit identity. |
add_shell_filter(rewrite) | Rewrite a shell command after it has been approved and before it runs. |
add_subagent_note(text) | Append a note to the prompt for a newly launched subagent. |
session_workspace(session) | Get the session's shell working directory. |
The built-in GitHub plugin uses these methods to set the bot account as the commit identity through environment variables and append a Co-authored-by trailer through a shell filter.
- The model controls subprocesses. Keep credentials such as API keys out of
set_process_env. A variable name may be set by only one plugin. rewrite(command)must be synchronous, fast, and free of side effects. Keep its changes small and predictable. If it raises an exception, ShiritaiBot ignores the rewrite and runs the original command.- ShiritaiBot removes these settings when the plugin reloads or is disabled.
Legacy plugin API
Early plugins used a plugin.toml manifest and an Entry class in main.py that imports the legacy API from shiritaibot.plugin_api. The lifecycle methods are start() and close().
main.py
from shiritaibot.plugin_api import Plugin, schema
class Entry(Plugin):
async def start(self):
self.context.register_tool("my_query", "工具说明", schema({}), self.query, risk="safe")
async def query(self, ctx, args):
return {"answer": "hello"}
ShiritaiBot still loads plugins in this format. Commands, message listeners, and the hooks described here require the current API. Use it for new plugins. If both manifests are present in the same directory, ShiritaiBot uses the current format.
We plan to remove the legacy API over the next few releases. Please migrate your plugins to the current API. Why not ask your ShiritaiBot to help?