2020-11-15 13:26:20 +08:00
|
|
|
import asyncio
|
|
|
|
|
|
|
|
from nonebot import on_message
|
2020-12-17 21:09:30 +08:00
|
|
|
from nonebot.typing import T_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
|
|
|
|
2020-12-17 21:09:30 +08:00
|
|
|
a = on_message(priority=0, permission=USER("123123123"), temp=True)
|
2020-11-15 13:26:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
@a.handle()
|
2020-12-17 21:09:30 +08:00
|
|
|
async def test_a(bot: Bot, event: Event, state: T_State):
|
2020-11-15 13:26:20 +08:00
|
|
|
print("======== A Received ========")
|
|
|
|
print("======== A Running Completed ========")
|
|
|
|
|
|
|
|
|
2020-12-17 21:09:30 +08:00
|
|
|
b = on_message(priority=0, permission=USER("123456789"), temp=True)
|
2020-11-15 13:26:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
@b.handle()
|
2020-12-17 21:09:30 +08:00
|
|
|
async def test_b(bot: Bot, event: Event, state: T_State):
|
2020-11-15 13:26:20 +08:00
|
|
|
print("======== B Received ========")
|
|
|
|
await asyncio.sleep(10)
|
|
|
|
print("======== B Running Completed ========")
|
|
|
|
|
|
|
|
|
2021-03-25 18:22:56 +08:00
|
|
|
c = on_message(priority=0, permission=USER("1111111111"))
|
2020-11-15 13:26:20 +08:00
|
|
|
|
|
|
|
|
|
|
|
@c.handle()
|
2020-12-17 21:09:30 +08:00
|
|
|
async def test_c(bot: Bot, event: Event, state: T_State):
|
2020-11-15 13:26:20 +08:00
|
|
|
print("======== C Received ========")
|