2023-06-20 13:50:05 +08:00
|
|
|
from nonebot import on_command
|
2020-08-29 21:59:36 +08:00
|
|
|
from nonebot.rule import to_me
|
2021-12-20 15:53:05 +08:00
|
|
|
from nonebot.adapters import Message
|
2021-12-25 18:46:44 +08:00
|
|
|
from nonebot.params import CommandArg
|
2023-06-20 13:50:05 +08:00
|
|
|
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,
|
|
|
|
)
|
2020-10-04 18:10:01 +08:00
|
|
|
|
|
|
|
echo = on_command("echo", to_me())
|
|
|
|
|
|
|
|
|
|
|
|
@echo.handle()
|
2022-09-09 11:52:57 +08:00
|
|
|
async def handle_echo(message: Message = CommandArg()):
|
2024-01-14 14:49:05 +08:00
|
|
|
if any((not seg.is_text()) or str(seg) for seg in message):
|
|
|
|
await echo.send(message=message)
|