mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-04 02:26:11 +08:00
use call api, not finish
This commit is contained in:
parent
578712546f
commit
3317c8f062
@ -8,6 +8,7 @@ from nonebot import on_command
|
|||||||
from .platform.utils import check_sub_target
|
from .platform.utils import check_sub_target
|
||||||
from .config import Config, NoSuchSubscribeException
|
from .config import Config, NoSuchSubscribeException
|
||||||
from .utils import parse_text
|
from .utils import parse_text
|
||||||
|
from .send import send_msgs
|
||||||
|
|
||||||
async def check_is_owner_or_admin(bot: Bot, event: Event):
|
async def check_is_owner_or_admin(bot: Bot, event: Event):
|
||||||
return await (GROUP_ADMIN | GROUP_OWNER)(bot, event)
|
return await (GROUP_ADMIN | GROUP_OWNER)(bot, event)
|
||||||
@ -37,7 +38,8 @@ async def _(bot: Bot, event: Event, state: T_State):
|
|||||||
res = '订阅的帐号为:\n'
|
res = '订阅的帐号为:\n'
|
||||||
for sub in sub_list:
|
for sub in sub_list:
|
||||||
res += '{} {} {}\n'.format(sub['target_type'], sub['target_name'], sub['target'])
|
res += '{} {} {}\n'.format(sub['target_type'], sub['target_name'], sub['target'])
|
||||||
await query_sub.finish(await parse_text(res))
|
send_msgs(bot, event.group_id, 'group', [await parse_text(res)])
|
||||||
|
await query_sub.finish()
|
||||||
|
|
||||||
del_sub = on_command("删除订阅", rule=to_me(), priority=5)
|
del_sub = on_command("删除订阅", rule=to_me(), priority=5)
|
||||||
@del_sub.handle()
|
@del_sub.handle()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user