How to use the nonebot.on_notice function in nonebot

To help you get started, we’ve selected a few nonebot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Joenothing-lst / kkl-Android-2.0 / kkl_bot / kkl / plugins / notices.py View on Github external
@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}')
github Joenothing-lst / kkl-Android-2.0 / kkl_bot / kkl / plugins / notices.py View on Github external
@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}]')
github Joenothing-lst / kkl-Android-2.0 / kkl_bot / kkl / plugins / notices.py View on Github external
@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}) 跑了')

nonebot

An asynchronous QQ bot framework based on CoolQ.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis