fix: consolidate stacked @filter.command decorators into single with alias
Three stacked @filter.command('pubg'), @filter.command('查ID'),
@filter.command('查询') decorated the same method, but
get_handler_or_create returns the same handler metadata for all
three, appending each CommandFilter to event_filters. In the
WakingCheckStage, all filters are AND'd, so the message would need
to start with all three command names simultaneously - impossible.
Fix: use @filter.command('pubg', alias={'查ID', '查询'}) which creates
a single CommandFilter that matches any of the three command names.
This commit is contained in:
4
main.py
4
main.py
@@ -434,9 +434,7 @@ class PubgPlugin(Star):
|
||||
return "steam"
|
||||
return self.config.get("default_platform", "steam")
|
||||
|
||||
@filter.command("pubg")
|
||||
@filter.command("查ID")
|
||||
@filter.command("查询")
|
||||
@filter.command("pubg", alias={"查ID", "查询"})
|
||||
async def query_stats(self, event: AstrMessageEvent):
|
||||
logger.info(f"[pubg_plugin] query_stats 被调用: message={event.message_str!r}")
|
||||
parts = event.message_str.strip().split()
|
||||
|
||||
Reference in New Issue
Block a user