From 897470ba15fb4ae23150f4aa72103db7e6473579 Mon Sep 17 00:00:00 2001 From: Nya_Twisuki <100500860+Twisuki@users.noreply.github.com> Date: Thu, 5 Dec 2024 19:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86MegaKits=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E6=AC=A1PR=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#19)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * modified: pyproject.toml nonebot_plugin_marshoai/tools/marshoai-megakits/ * modified: nonebot_plugin_marshoai/models.py new file: nonebot_plugin_marshoai/tools/marshoai-megakits/a.py nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json * modified: nonebot_plugin_marshoai/models.py nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json * deleted: nonebot_plugin_marshoai/tools/marshoai-megakits/a.py new file: nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Common.py new file: nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Info.py new file: nonebot_plugin_marshoai/tools/marshoai-megakits/mk_MorseCode.py new file: nonebot_plugin_marshoai/tools/marshoai-megakits/mk_NyaCode.py nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json * modified: nonebot_plugin_marshoai/models.py modified: nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Info.py modified: nonebot_plugin_marshoai/util.py modified: pyproject.toml nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json * modified: nonebot_plugin_marshoai/models.py modified: nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Info.py modified: nonebot_plugin_marshoai/util.py modified: pyproject.toml nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json --- .../tools/marshoai-megakits/__init__.py | 37 +++++ .../tools/marshoai-megakits/tools.json | 142 ++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py create mode 100644 nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json diff --git a/nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py b/nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py new file mode 100644 index 00000000..c590b032 --- /dev/null +++ b/nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py @@ -0,0 +1,37 @@ + +from . import mk_Info +from . import mk_Common +from . import mk_MorseCode +from . import mk_NyaCode + +# Twisuki +async def twisuki(): + return str(mk_Info.twisuki()) + +# MegaKits +async def megakits(): + return str(mk_Info.megakits()) + +# Random Turntable +async def random_turntable(upper: int, lower: int = "0"): + return str(mk_Common.random_turntable(upper, lower)) + +# Number Calc +async def number_calc(a: str, b: str, op: str): + return str(mk_Common.number_calc(a, b, op)) + +# MorseCode Encrypt +async def morse_encrypt(msg: str): + return str(mk_MorseCode.morse_encrypt(msg)) + +# MorseCode Decrypt +async def morse_decrypt(msg: str): + return str(mk_MorseCode.morse_decrypt(msg)) + +# NyaCode Encrypt +async def nya_encode(msg: str): + return str(mk_NyaCode.nya_encode(msg)) + +# NyaCode Decrypt +async def nya_decode(msg: str): + return str(mk_NyaCode.nya_decode(msg)) diff --git a/nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json b/nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json new file mode 100644 index 00000000..397494f0 --- /dev/null +++ b/nonebot_plugin_marshoai/tools/marshoai-megakits/tools.json @@ -0,0 +1,142 @@ +[ + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__twisuki", + "description" : "介绍插件作者Twisuki(苏阳)" + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__megakits", + "description" : "介绍本插件MegaKits" + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__random_turntable", + "description" : "随机转盘, 玩家输入上下限(均为整数), 返回一个随机整数", + "parameters" : { + "type" : "object", + "properties" : { + "upper" : { + "type" : "integer", + "description" : "随机数上限" + }, + "lower" : { + "type" : "integer", + "description" : "随机数下限" + } + } + }, + "require" : [ + "upper" + ] + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__number_calc", + "description" : "数字计算器, 可对整数 小数做加减乘除, 乘方 取余运算", + "parameters" : { + "type" : "object", + "properties" : { + "a" : { + "type" : "string", + "description" : "第一个运算数" + }, + "b" : { + "type" : "string", + "description" : "第二个运算数" + }, + "op" : { + "type" : "string", + "description" : "运算符, 目前仅支持 + - * / %(取余) **(乘方)" + } + } + }, + "require" : [ + "a", "b", "op" + ] + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__morse_encrypt", + "description" : "摩尔斯电码加密, 输入一个字符串, 返回由.- 组成的摩尔斯电码", + "parameters" : { + "type" : "object", + "properties" : { + "msg" : { + "type" : "string", + "description" : "录入的字符串(包含字母, 数字, 部分标点符号(.:,;?='/!-_\"()$&@))" + } + }, + "require" : [ + "msg" + ] + } + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__morse_decrypt", + "description" : "摩尔斯电码解码, 输入一个字符串(由.- 组成), 返回由解码", + "parameters" : { + "type" : "object", + "properties" : { + "msg" : { + "type" : "string", + "description" : "录入的字符串(.- )" + } + }, + "require" : [ + "msg" + ] + } + } + }, + { + "type" : "function", + "function" : { + "name" : "marshoai-megakits__nya_encode", + "description" : "转换为猫猫语", + "parameters" : { + "type" : "object", + "properties" : { + "msg" : { + "type" : "string", + "description" : "待转换的字符串" + } + }, + "require" : [ + "msg" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "marshoai-megakits__nya_decode", + "description": "翻译猫语", + "parameters": { + "type": "object", + "properties": { + "msg": { + "type": "string", + "description": "录入的猫语" + } + }, + "require": [ + "msg" + ] + } + } + } +] \ No newline at end of file