add plugin metadata to builtin plugins (#2113)

This commit is contained in:
Ju4tCode
2023-06-20 13:50:05 +08:00
committed by GitHub
parent 20d3d62bd5
commit e00890033e
5 changed files with 38 additions and 5 deletions

View File

@ -1,7 +1,18 @@
from nonebot import on_command
from nonebot.rule import to_me
from nonebot.adapters import Message
from nonebot.params import CommandArg
from nonebot.plugin import on_command
from nonebot.plugin import PluginMetadata
__plugin_meta__ = PluginMetadata(
name="echo",
description="重复你说的话",
usage="/echo [text]",
type="application",
homepage="https://github.com/nonebot/nonebot2/blob/master/nonebot/plugins/echo.py",
config=None,
supported_adapters=None,
)
echo = on_command("echo", to_me())

View File

@ -2,8 +2,19 @@ from typing import Dict, AsyncGenerator
from nonebot.adapters import Event
from nonebot.params import Depends
from nonebot.plugin import PluginMetadata
from nonebot.message import IgnoredException, event_preprocessor
__plugin_meta__ = PluginMetadata(
name="唯一会话",
description="限制同一会话内同时只能运行一个响应器",
usage="加载插件后自动生效",
type="application",
homepage="https://github.com/nonebot/nonebot2/blob/master/nonebot/plugins/single_session.py",
config=None,
supported_adapters=None,
)
_running_matcher: Dict[str, int] = {}