use call api, not finish

This commit is contained in:
felinae98 2021-02-08 12:49:41 +08:00
parent 578712546f
commit 3317c8f062
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610

View File

@ -8,6 +8,7 @@ from nonebot import on_command
from .platform.utils import check_sub_target
from .config import Config, NoSuchSubscribeException
from .utils import parse_text
from .send import send_msgs
async def check_is_owner_or_admin(bot: Bot, event: Event):
return await (GROUP_ADMIN | GROUP_OWNER)(bot, event)
@ -37,7 +38,8 @@ async def _(bot: Bot, event: Event, state: T_State):
res = '订阅的帐号为:\n'
for sub in sub_list:
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.handle()