mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-30 22:46:40 +00:00 
			
		
		
		
	✅ add command alias/group test
This commit is contained in:
		
							
								
								
									
										6
									
								
								tests/test_plugins/test_group/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								tests/test_plugins/test_group/__init__.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| from nonebot.rule import to_me | ||||
| from nonebot import CommandGroup | ||||
|  | ||||
| test = CommandGroup("test", rule=to_me()) | ||||
|  | ||||
| from . import commands | ||||
							
								
								
									
										11
									
								
								tests/test_plugins/test_group/commands.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								tests/test_plugins/test_group/commands.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| from nonebot.typing import Bot, Event | ||||
| from nonebot.permission import GROUP_OWNER | ||||
|  | ||||
| from . import test | ||||
|  | ||||
| test_1 = test.command("1", aliases={"test"}, permission=GROUP_OWNER) | ||||
|  | ||||
|  | ||||
| @test_1.handle() | ||||
| async def test1(bot: Bot, event: Event, state: dict): | ||||
|     await test_1.finish(event.raw_message) | ||||
		Reference in New Issue
	
	Block a user