zhenxun_bot/plugins/coser/__init__.py

40 lines
1.1 KiB
Python
Raw Normal View History

2021-05-20 19:21:05 +08:00
from nonebot import on_command
from nonebot.typing import T_State
2021-11-23 21:44:59 +08:00
from nonebot.adapters.cqhttp import Bot, MessageEvent
2021-07-30 21:21:51 +08:00
from utils.message_builder import image
2021-11-23 21:44:59 +08:00
from services.log import logger
2021-05-20 19:21:05 +08:00
2021-10-03 14:24:07 +08:00
__zx_plugin_name__ = "coser"
__plugin_usage__ = """
usage
三次元也不戳嘿嘿嘿
指令
cos/coser
""".strip()
__plugin_des__ = "三次元也不戳,嘿嘿嘿"
__plugin_cmd__ = ["cos/coser"]
__plugin_version__ = 0.1
__plugin_author__ = "HibiKier"
__plugin_settings__ = {
"level": 5,
"default_status": True,
"limit_superuser": False,
"cmd": ["cos", "coser", "括丝", "COS", "Cos", "cOS", "coS"],
}
2021-05-20 19:21:05 +08:00
2021-07-30 21:21:51 +08:00
coser = on_command(
"cos", aliases={"coser", "括丝", "COS", "Cos", "cOS", "coS"}, priority=5, block=True
)
2021-05-20 19:21:05 +08:00
2021-11-23 21:44:59 +08:00
url = "http://iw233.cn/API/cos.php"
2021-05-20 19:21:05 +08:00
@coser.handle()
2021-07-30 21:21:51 +08:00
async def _(bot: Bot, event: MessageEvent, state: T_State):
2021-11-23 21:44:59 +08:00
try:
await coser.send(image(url))
except Exception as e:
await coser.send("你cos给我看")
logger.error(f"coser 发送了未知错误 {type(e)}{e}")