From e179543742f9ebe21e2c128741b07ef88d914576 Mon Sep 17 00:00:00 2001 From: Snowykami Date: Fri, 13 Dec 2024 03:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=B7=BB=E5=8A=A0=20mk=5Fcommon.py?= =?UTF-8?q?=20=E5=92=8C=20mk=5Finfo.py=20=E6=96=87=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E9=9A=8F=E6=9C=BA=E8=BD=AC=E7=9B=98=E5=92=8C?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E8=AE=A1=E7=AE=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/marshoai_megakits/mk_common.py | 45 +++++++++++++++++++ .../tools/marshoai_megakits/mk_info.py | 8 ++++ 2 files changed, 53 insertions(+) create mode 100644 nonebot_plugin_marshoai/tools/marshoai_megakits/mk_common.py create mode 100644 nonebot_plugin_marshoai/tools/marshoai_megakits/mk_info.py diff --git a/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_common.py b/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_common.py new file mode 100644 index 00000000..c049703a --- /dev/null +++ b/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_common.py @@ -0,0 +1,45 @@ +import random + + +async def random_turntable(upper: int, lower: int): + """Random Turntable + + Args: + upper (int): _description_ + lower (int): _description_ + + Returns: + _type_: _description_ + """ + return random.randint(lower, upper) + + + +async def number_calc(a: str, b: str, op: str) -> str: + """Number Calc + + Args: + a (str): _description_ + b (str): _description_ + op (str): _description_ + + Returns: + str: _description_ + """ + a, b = float(a), float(b) # type: ignore + match op: + case "+": + return str(a + b) # type: ignore + case "-": + return str(a - b) # type: ignore + case "*": + return str(a * b) # type: ignore + case "/": + return str(a / b) # type: ignore + case "**": + return str(a**b) # type: ignore + case "%": + return str(a % b) + case _: + return "未知运算符" + \ No newline at end of file diff --git a/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_info.py b/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_info.py new file mode 100644 index 00000000..af364c8d --- /dev/null +++ b/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_info.py @@ -0,0 +1,8 @@ +# Twisuki +async def twisuki(): + return 'Twiuski(苏阳)是megakits插件作者, Github : "https://github.com/Twisuki"' + + +# MegaKits +async def megakits(): + return 'MegaKits插件是一个功能混杂的MarshoAI插件, 由Twisuki(Github : "https://github.com/Twisuki")开发, 插件仓库 : "https://github.com/LiteyukiStudio/marsho-toolsets/tree/main/Twisuki/marshoai-megakits"'