mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-28 00:31:14 +00:00
🐛 fix: strip after at bot
This commit is contained in:
@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from nonebot.rule import to_me
|
||||
from nonebot.typing import Event
|
||||
from nonebot.plugin import on_message
|
||||
from nonebot.adapters.cqhttp import Bot
|
||||
|
||||
test_message = on_message(state={"default": 1})
|
||||
test_message = on_message(to_me(), state={"default": 1})
|
||||
|
||||
|
||||
@test_message.handle()
|
||||
|
15
tests/test_plugins/test_permission.py
Normal file
15
tests/test_plugins/test_permission.py
Normal file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from nonebot.rule import to_me
|
||||
from nonebot.typing import Event
|
||||
from nonebot.plugin import on_startswith
|
||||
from nonebot.adapters.cqhttp import Bot
|
||||
from nonebot.permission import GROUP_ADMIN
|
||||
|
||||
test_command = on_startswith("hello", to_me(), permission=GROUP_ADMIN)
|
||||
|
||||
|
||||
@test_command.handle()
|
||||
async def test_handler(bot: Bot, event: Event, state: dict):
|
||||
await test_command.finish("hello")
|
Reference in New Issue
Block a user