Skip to content

Amadeus的Typo形态:A Mai De Su(一只麦麦哦)。MaiBot的Vtuber项目

Notifications You must be signed in to change notification settings

tcmofashi/Amaidesu

 
 

Repository files navigation


Amaidesu

Amadeus?

Amaidesu!

-project alphia - 在zzzzyc/d的强烈要求下添加

Python Version Status Contributors forks stars issues

📝 项目简介

聊天机器人麦麦的VTubeStudio 适配器。 其聊天核心为麦麦Bot,一款专注于 群组聊天 的赛博网友 QQ BOT。

架构概述

MaiBot-Vtuber 采用模块化设计,主要由以下几个核心组件构成:

  1. AmaidesuCore: 核心模块,负责与 MaiCore 的通信
  2. PluginManager: 插件管理器,负责插件的加载和管理
  3. BasePlugin: 插件基类,定义插件的基本接口
  4. 插件系统: 各种功能插件,如 TTS、STT、LLM 等

消息处理时序图

sequenceDiagram
    participant User
    participant ConsoleInput
    participant AmaidesuCore
    participant PluginManager
    participant Plugins
    participant MaiCore

    User->>ConsoleInput: 输入消息
    ConsoleInput->>AmaidesuCore: 发送消息
    AmaidesuCore->>PluginManager: 分发消息
    PluginManager->>Plugins: 处理消息
    Plugins->>AmaidesuCore: 返回处理结果
    AmaidesuCore->>MaiCore: 发送处理后的消息
    MaiCore-->>AmaidesuCore: 返回响应
    AmaidesuCore-->>Plugins: 分发响应
    Plugins-->>AmaidesuCore: 处理响应
    AmaidesuCore-->>ConsoleInput: 返回最终结果
    ConsoleInput-->>User: 显示结果
Loading

插件开发

插件开发需要继承 BasePlugin 类并实现必要的方法:

from src.core.plugin_manager import BasePlugin

class MyPlugin(BasePlugin):
    async def setup(self):
        # 注册消息处理器
        await self.core.register_websocket_handler("text", self.handle_message)
    
    async def handle_message(self, message):
        # 处理消息
        pass
    
    async def cleanup(self):
        # 清理资源
        pass

安装与运行

  1. 克隆仓库
  2. 安装依赖:pip install -r requirements.txt
  3. 复制 config-template.tomlconfig.toml 并配置
  4. 运行:python main.py

调试模式

使用 --debug 参数启用调试日志:

python main.py --debug

模拟MaiCore

当你不方便部署麦麦时,可以用它启用一个ws服务端和一个控制台输入任务,便于模拟麦麦的回应来测试插件功能

使用方法:

python mock_maicore.py

如果你需要更多帮助-查阅help.md

About

Amadeus的Typo形态:A Mai De Su(一只麦麦哦)。MaiBot的Vtuber项目

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%