feat: add rate limiting and improve event handling

- Introduced rate limiting configuration in config.toml with options for enabling, requests per second (RPS), and burst capacity.
- Enhanced event handling in the OneBot11 adapter to ignore messages sent by the bot itself.
- Updated the dispatcher to register rate limit middleware based on configuration settings.
- Refactored WebSocket message handling to support flexible JSON parsing and improved event type detection.
- Removed deprecated echo plugin and associated tests to streamline the codebase.
This commit is contained in:
lafay
2026-01-05 01:00:38 +08:00
parent 44fe05ff62
commit d16261e6bd
11 changed files with 1001 additions and 427 deletions

View File

@@ -18,6 +18,11 @@ version = "1.0"
[protocol.options]
# Protocol specific options can be added here
[engine.rate_limit]
enabled = true
rps = 100 # 每秒请求数
burst = 200 # 突发容量
# ============================================================================
# Bot 配置
# ============================================================================