mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 00:01:27 +00:00
✅ test matchergroup
This commit is contained in:
@ -215,7 +215,7 @@ def run(host: Optional[str] = None,
|
||||
get_driver().run(host, port, *args, **kwargs)
|
||||
|
||||
|
||||
from nonebot.plugin import on_message, on_notice, on_request, on_metaevent, CommandGroup
|
||||
from nonebot.plugin import on_message, on_notice, on_request, on_metaevent, CommandGroup, MatcherGroup
|
||||
from nonebot.plugin import on_startswith, on_endswith, on_keyword, on_command, on_regex
|
||||
from nonebot.plugin import load_plugin, load_plugins, load_builtin_plugins
|
||||
from nonebot.plugin import export, require, get_plugin, get_loaded_plugins
|
||||
|
@ -555,8 +555,8 @@ class MatcherGroup:
|
||||
"""
|
||||
final_kwargs = self.base_kwargs.copy()
|
||||
final_kwargs.update(kwargs)
|
||||
final_kwargs["type"] = "meta_event"
|
||||
matcher = Matcher.new(**final_kwargs)
|
||||
final_kwargs.pop("type", None)
|
||||
matcher = Matcher.new("meta_event", **final_kwargs)
|
||||
self.matchers.append(matcher)
|
||||
_tmp_matchers.get().add(matcher)
|
||||
return matcher
|
||||
@ -583,8 +583,8 @@ class MatcherGroup:
|
||||
"""
|
||||
final_kwargs = self.base_kwargs.copy()
|
||||
final_kwargs.update(kwargs)
|
||||
final_kwargs["type"] = "message"
|
||||
matcher = Matcher.new(**final_kwargs)
|
||||
final_kwargs.pop("type", None)
|
||||
matcher = Matcher.new("message", **final_kwargs)
|
||||
self.matchers.append(matcher)
|
||||
_tmp_matchers.get().add(matcher)
|
||||
return matcher
|
||||
@ -610,8 +610,8 @@ class MatcherGroup:
|
||||
"""
|
||||
final_kwargs = self.base_kwargs.copy()
|
||||
final_kwargs.update(kwargs)
|
||||
final_kwargs["type"] = "notice"
|
||||
matcher = Matcher.new(**final_kwargs)
|
||||
final_kwargs.pop("type", None)
|
||||
matcher = Matcher.new("notice", **final_kwargs)
|
||||
self.matchers.append(matcher)
|
||||
_tmp_matchers.get().add(matcher)
|
||||
return matcher
|
||||
@ -637,8 +637,8 @@ class MatcherGroup:
|
||||
"""
|
||||
final_kwargs = self.base_kwargs.copy()
|
||||
final_kwargs.update(kwargs)
|
||||
final_kwargs["type"] = "request"
|
||||
matcher = Matcher.new(**final_kwargs)
|
||||
final_kwargs.pop("type", None)
|
||||
matcher = Matcher.new("request", **final_kwargs)
|
||||
self.matchers.append(matcher)
|
||||
_tmp_matchers.get().add(matcher)
|
||||
return matcher
|
||||
|
Reference in New Issue
Block a user