@@ -49,7 +49,11 @@ async def parse_platform(bot: Bot, event: Event, state: T_State) -> None:
49
49
@add_sub .got ('platform' , '{_prompt}' , parse_platform )
50
50
@add_sub .handle ()
51
51
async def init_id (bot : Bot , event : Event , state : T_State ):
52
- state ['_prompt' ] = '请输入订阅用户的id,详情查阅https://github.com/felinae98/nonebot-hk-reporter'
52
+ if platform_manager [state ['platform' ]].has_target :
53
+ state ['_prompt' ] = '请输入订阅用户的id,详情查阅https://github.com/felinae98/nonebot-hk-reporter'
54
+ else :
55
+ state ['id' ] = 'default'
56
+ state ['name' ] = await platform_manager [state ['platform' ]].get_account_name (Target ('' ))
53
57
54
58
async def parse_id (bot : Bot , event : Event , state : T_State ):
55
59
target = str (event .get_message ()).strip ()
@@ -93,9 +97,6 @@ async def parser_tags(bot: Bot, event: Event, state: T_State):
93
97
@add_sub .got ('tags' , '{_prompt}' , parser_tags )
94
98
@add_sub .handle ()
95
99
async def add_sub_process (bot : Bot , event : Event , state : T_State ):
96
- if not platform_manager [state ['platform' ]].has_target :
97
- state ['name' ] = await platform_manager [state ['platform' ]].get_account_name (Target ('' ))
98
- state ['id' ] = 'default'
99
100
config = Config ()
100
101
config .add_subscribe (state .get ('_user_id' ) or event .group_id , user_type = 'group' ,
101
102
target = state ['id' ],
0 commit comments