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:
@@ -68,6 +68,10 @@ type EventHandler interface {
|
||||
Priority() int
|
||||
// Match 判断是否匹配事件
|
||||
Match(event Event) bool
|
||||
// Name 获取处理器名称
|
||||
Name() string
|
||||
// Description 获取处理器描述
|
||||
Description() string
|
||||
}
|
||||
|
||||
// Middleware 中间件接口
|
||||
|
||||
Reference in New Issue
Block a user