Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 801 Bytes

File metadata and controls

53 lines (37 loc) · 801 Bytes

MaiBot Telegram Adapter

一个连接MaiBot服务器和Telegram的适配器,通过WebSocket实现消息双向转发。

功能

  • 通过WebSocket连接MaiBot服务器
  • 转发Telegram消息到MaiBot
  • 转发MaiBot消息到Telegram
  • 支持消息过滤
  • 自动重连

配置

创建 config.toml 文件:

Platform = "telegram"
TelegramBotToken = "YOUR_BOT_TOKEN"

[MaiBot]
URL = "ws://localhost:8080"

[MessageFilter]
BannedUsers = []

[MessageFilter.Groups]
Mode = "whitelist"
List = []

[MessageFilter.Private]
Mode = "blacklist"
List = []

运行

go run cmd/maibot-telegram-adapter.go

或者:

go build -o maibot-telegram-adapter cmd/maibot-telegram-adapter.go
./maibot-telegram-adapter

依赖

  • Go 1.24.2+
  • Telegram Bot Token
  • MaiBot