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:
@@ -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 配置
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user