Skip to content

MaiBot Plugin Development Documentation

Welcome to the MaiBot plugin system development documentation! This is the best starting point for your plugin development journey.

Getting Started

Component Function Details

Command vs Action vs Tool Selection Guide

  1. When to use Command
  • ✅ Users need to explicitly call specific functions
  • ✅ Require precise parameter control
  • ✅ Management and configuration operations
  • ✅ Query and information display
  1. When to use Action
  • ✅ Enhance MaiMai's intelligent behavior
  • ✅ Automatically triggered based on context
  • ✅ Emotion and expression display
  • ✅ Randomized interactions
  1. When to use Tool
  • Directly provide information to MaiMai
  • Provide more available information when replying
  • Simple to use, specialized functionality

API Browser

Message Sending and Processing API

  • 📤 Send API - Various types of message sending interfaces
  • Message API - Message acquisition, message construction, message query interfaces
  • Chat Flow API - Chat flow management and query interfaces

AI and Generation API

  • LLM API - Large language model interaction interface, can use built-in LLM to generate content
  • ✨ Reply Generator API - Intelligent reply generation interface, can use built-in stylized generators

Emoji API

Relationship System API

Data and Configuration API

Plugin and Component Management API

Logging API

Tool API

A Convenient Small Design

We define an __all__ variable in __init__.py that contains all classes and functions that need to be exported. This way, when importing elsewhere, you can directly use from src.plugin_system import * to import all plugin-related classes and functions. Or you can directly use from src.plugin_system import BasePlugin, register_plugin, ComponentInfo and similar ways to import the parts you need.