Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@on_request('group')
async def bot_request(session: RequestSession):
global request_flag
f_group= session.ctx['group_id']
f_user= session.ctx['user_id']
if session.ctx['sub_type']=='invite':
if request_flag == False:
await session.bot.send_private_msg(user_id=f_user,message=f'想邀请可可萝入群嘛?请先点击这里联系作者:\nhttps://wpa.qq.com/msgrd?v=3&uin={master}&site=qq&menu=yes')
await session.bot.send_private_msg(user_id=master,message=f'有新的群邀请:\n群:{f_group}\n邀请人:{f_user}\n已忽略')
else :
try:
await session.approve()
except ActionFailed as e:
print(e.retcode)
await session.bot.send_private_msg(user_id=master,message=f'有新的群邀请:\n群:{f_group}\n邀请人:{f_user}\n已同意')
request_flag=False