mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 03:57:00 +08:00
🐛 fix matcher group send
This commit is contained in:
parent
4e2b74af75
commit
d9f8bf38c6
@ -570,37 +570,38 @@ class MatcherGroup:
|
|||||||
|
|
||||||
return _decorator
|
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()
|
bot = current_bot.get()
|
||||||
event = current_event.get()
|
event = current_event.get()
|
||||||
await bot.send(event=event, message=message)
|
await bot.send(event=event, message=message, **kwargs)
|
||||||
|
|
||||||
async def finish(
|
async def finish(self,
|
||||||
self,
|
message: Optional[Union[str, Message,
|
||||||
message: Optional[Union[str, Message,
|
MessageSegment]] = None,
|
||||||
MessageSegment]] = None) -> NoReturn:
|
**kwargs) -> NoReturn:
|
||||||
bot = current_bot.get()
|
bot = current_bot.get()
|
||||||
event = current_event.get()
|
event = current_event.get()
|
||||||
if message:
|
if message:
|
||||||
await bot.send(event=event, message=message)
|
await bot.send(event=event, message=message, **kwargs)
|
||||||
raise FinishedException
|
raise FinishedException
|
||||||
|
|
||||||
async def pause(
|
async def pause(self,
|
||||||
self,
|
prompt: Optional[Union[str, Message,
|
||||||
prompt: Optional[Union[str, Message,
|
MessageSegment]] = None,
|
||||||
MessageSegment]] = None) -> NoReturn:
|
**kwargs) -> NoReturn:
|
||||||
bot = current_bot.get()
|
bot = current_bot.get()
|
||||||
event = current_event.get()
|
event = current_event.get()
|
||||||
if prompt:
|
if prompt:
|
||||||
await bot.send(event=event, message=prompt)
|
await bot.send(event=event, message=prompt, **kwargs)
|
||||||
raise PausedException
|
raise PausedException
|
||||||
|
|
||||||
async def reject(
|
async def reject(self,
|
||||||
self,
|
prompt: Optional[Union[str, Message,
|
||||||
prompt: Optional[Union[str, Message,
|
MessageSegment]] = None,
|
||||||
MessageSegment]] = None) -> NoReturn:
|
**kwargs) -> NoReturn:
|
||||||
bot = current_bot.get()
|
bot = current_bot.get()
|
||||||
event = current_event.get()
|
event = current_event.get()
|
||||||
if prompt:
|
if prompt:
|
||||||
await bot.send(event=event, message=prompt)
|
await bot.send(event=event, message=prompt, **kwargs)
|
||||||
raise RejectedException
|
raise RejectedException
|
||||||
|
Loading…
Reference in New Issue
Block a user