2020-11-15 13:26:20 +08:00
|
|
|
import asyncio
|
|
|
|
|
|
|
|
from nonebot import on_message
|
2020-12-07 00:06:09 +08:00
|
|
|
from nonebot.typing import State
|
2020-11-15 13:26:20 +08:00
|
|
|
from nonebot.permission import USER
|
2020-12-07 00:06:09 +08:00
|
|
|
from nonebot.adapters import Bot, Event
|
2020-11-15 13:26:20 +08:00
|
|
|
|
|
|
|
a = on_message(priority=0, permission=USER(123123123), temp=True)
|
|
|
|
|
|
|
|
|
|
|
|
@a.handle()
|
2020-12-07 00:06:09 +08:00
|
|
|
async def test_a(bot: Bot, event: Event, state: State):
|
2020-11-15 13:26:20 +08:00
|
|
|
print("======== A Received ========")
|
|
|
|
print("======== A Running Completed ========")
|
|
|
|
|
|
|
|
|
|
|
|
b = on_message(priority=0, permission=USER(123456789), temp=True)
|
|
|
|
|
|
|
|
|
|
|
|
@b.handle()
|
2020-12-07 00:06:09 +08:00
|
|
|
async def test_b(bot: Bot, event: Event, state: State):
|
2020-11-15 13:26:20 +08:00
|
|
|
print("======== B Received ========")
|
|
|
|
await asyncio.sleep(10)
|
|
|
|
print("======== B Running Completed ========")
|
|
|
|
|
|
|
|
|
|
|
|
c = on_message(priority=0, permission=USER(1111111111))
|
|
|
|
|
|
|
|
|
|
|
|
@c.handle()
|
2020-12-07 00:06:09 +08:00
|
|
|
async def test_c(bot: Bot, event: Event, state: State):
|
2020-11-15 13:26:20 +08:00
|
|
|
print("======== C Received ========")
|