mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-16 09:26:07 +00:00
refactor: 独立ratelimiter包
This commit is contained in:
@@ -22,6 +22,7 @@ from .resprule import resprule
|
||||
from .bansess import bansess
|
||||
from .cntfilter import cntfilter
|
||||
from .longtext import longtext
|
||||
from .ratelim import ratelim
|
||||
|
||||
from ..boot import app
|
||||
|
||||
@@ -44,6 +45,7 @@ class QQBotManager:
|
||||
cntfilter_mgr: cntfilter.ContentFilterManager = None
|
||||
longtext_pcs: longtext.LongTextProcessor = None
|
||||
resprule_chkr: resprule.GroupRespondRuleChecker = None
|
||||
ratelimiter: ratelim.RateLimiter = None
|
||||
|
||||
def __init__(self, first_time_init=True, ap: app.Application = None):
|
||||
config = context.get_config_manager().data
|
||||
@@ -53,6 +55,7 @@ class QQBotManager:
|
||||
self.cntfilter_mgr = cntfilter.ContentFilterManager(ap)
|
||||
self.longtext_pcs = longtext.LongTextProcessor(ap)
|
||||
self.resprule_chkr = resprule.GroupRespondRuleChecker(ap)
|
||||
self.ratelimiter = ratelim.RateLimiter(ap)
|
||||
|
||||
self.timeout = config['process_message_timeout']
|
||||
self.retry = config['retry_times']
|
||||
@@ -62,6 +65,7 @@ class QQBotManager:
|
||||
await self.cntfilter_mgr.initialize()
|
||||
await self.longtext_pcs.initialize()
|
||||
await self.resprule_chkr.initialize()
|
||||
await self.ratelimiter.initialize()
|
||||
|
||||
config = context.get_config_manager().data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user