mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 04:16:57 +08:00
Add comments
This commit is contained in:
parent
39b04b880a
commit
8d7f06fdde
@ -45,7 +45,12 @@ class RequestSession(BaseSession):
|
|||||||
def __init__(self, bot: NoneBot, ctx: Dict[str, Any]):
|
def __init__(self, bot: NoneBot, ctx: Dict[str, Any]):
|
||||||
super().__init__(bot, ctx)
|
super().__init__(bot, ctx)
|
||||||
|
|
||||||
async def approve(self, remark: str = ''):
|
async def approve(self, remark: str = '') -> None:
|
||||||
|
"""
|
||||||
|
Approve the request.
|
||||||
|
|
||||||
|
:param remark: remark of friend (only works in friend request)
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
await self.bot.call_action(
|
await self.bot.call_action(
|
||||||
action='.handle_quick_operation_async',
|
action='.handle_quick_operation_async',
|
||||||
@ -56,7 +61,12 @@ class RequestSession(BaseSession):
|
|||||||
except CQHttpError:
|
except CQHttpError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def reject(self, reason: str = ''):
|
async def reject(self, reason: str = '') -> None:
|
||||||
|
"""
|
||||||
|
Reject the request.
|
||||||
|
|
||||||
|
:param reason: reason to reject (only works in group request)
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
await self.bot.call_action(
|
await self.bot.call_action(
|
||||||
action='.handle_quick_operation_async',
|
action='.handle_quick_operation_async',
|
||||||
|
Loading…
Reference in New Issue
Block a user