From d9f8bf38c61e2920c9efd8c849ac1808b6ffcede Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 22 Oct 2020 00:00:29 +0800 Subject: [PATCH] :bug: fix matcher group send --- nonebot/matcher.py | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/nonebot/matcher.py b/nonebot/matcher.py index 157e4cf8..f4f67245 100644 --- a/nonebot/matcher.py +++ b/nonebot/matcher.py @@ -570,37 +570,38 @@ class MatcherGroup: return _decorator - async def send(self, message: Union[str, Message, MessageSegment]): + async def send(self, message: Union[str, Message, MessageSegment], + **kwargs): bot = current_bot.get() event = current_event.get() - await bot.send(event=event, message=message) + await bot.send(event=event, message=message, **kwargs) - async def finish( - self, - message: Optional[Union[str, Message, - MessageSegment]] = None) -> NoReturn: + async def finish(self, + message: Optional[Union[str, Message, + MessageSegment]] = None, + **kwargs) -> NoReturn: bot = current_bot.get() event = current_event.get() if message: - await bot.send(event=event, message=message) + await bot.send(event=event, message=message, **kwargs) raise FinishedException - async def pause( - self, - prompt: Optional[Union[str, Message, - MessageSegment]] = None) -> NoReturn: + async def pause(self, + prompt: Optional[Union[str, Message, + MessageSegment]] = None, + **kwargs) -> NoReturn: bot = current_bot.get() event = current_event.get() if prompt: - await bot.send(event=event, message=prompt) + await bot.send(event=event, message=prompt, **kwargs) raise PausedException - async def reject( - self, - prompt: Optional[Union[str, Message, - MessageSegment]] = None) -> NoReturn: + async def reject(self, + prompt: Optional[Union[str, Message, + MessageSegment]] = None, + **kwargs) -> NoReturn: bot = current_bot.get() event = current_event.get() if prompt: - await bot.send(event=event, message=prompt) + await bot.send(event=event, message=prompt, **kwargs) raise RejectedException