Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@on_notice('friend_add')
async def friend_add(session: NoticeSession):
f_user=session.ctx['user_id']
await bot.send_private_msg(user_id=master,message=f'有人加我啦!\n{f_user}')
@on_notice('group_increase')
async def increase(session: NoticeSession):
# 发送欢迎消息
q = session.ctx['user_id']
me = session.ctx['self_id']
# 判断新成员是否是自己
if q==me:
await session.send('在下是可可萝,今后请多指教呐')
else:
await session.send(f'欢迎新大佬 [CQ:at,qq={q}]')
@on_notice('group_decrease')
async def decrease(session: NoticeSession):
# 发送消息
q = str(session.ctx['user_id'])
m = str(session.ctx['operator_id'])
if m==q:
inf=await bot.get_stranger_info(user_id=q)
name=inf['nickname']
await session.send(f'{name}({q}) 跑了')