async def feed_rec(bot: Bot, event: CQEvent, state: T_State): uid = event.user_id user_info = await bot.get_stranger_info(user_id=uid) nickname = user_info.get('nickname', '未知用户') if not lmt.check(uid): if isinstance(event, GroupMessageEvent): await feed_back.finish(f'>{nickname}\n您今天已经反馈过{_max}次了,请明早5点后再来!') elif isinstance(event, PrivateMessageEvent): await feed_back.finish(EXCEED_NOTICE) lmt.increase(uid) args = event.get_message() if args: state['text'] = args if isinstance(event, GroupMessageEvent): message = f'>{nickname}\n请发送您要反馈的内容~' elif isinstance(event, PrivateMessageEvent): message = '请发送您要反馈的内容~' state['prompt'] = message
async def bc_rec(bot: Bot, event: CQEvent, state: T_State): if event.user_id not in salmon.configs.SUPERUSERS: await broadcast.finish('Insufficient authority.') msg = event.get_message() if msg: state['msg'] = msg