-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ 更新 mypy 版本至 1.13.0,重构 marshoai-megakits 模块并添加随机数和计算功能
- Loading branch information
Showing
25 changed files
with
101 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
nonebot_plugin_marshoai/tools/marshoai-megakits/__init__.py
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
nonebot_plugin_marshoai/tools/marshoai-megakits/mk_Common.py
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
41 changes: 41 additions & 0 deletions
41
nonebot_plugin_marshoai/tools/marshoai_megakits/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from . import mk_common, mk_info, mk_morse_code, mk_nya_code | ||
|
||
|
||
# Twisuki | ||
async def twisuki(): | ||
return str(await mk_info.twisuki()) | ||
|
||
|
||
# MegaKits | ||
async def megakits(): | ||
return str(await mk_info.megakits()) | ||
|
||
|
||
# Random Turntable | ||
async def random_turntable(upper: int, lower: int = 0): | ||
return str(await mk_common.random_turntable(upper, lower)) | ||
|
||
|
||
# Number Calc | ||
async def number_calc(a: str, b: str, op: str): | ||
return str(await mk_common.number_calc(a, b, op)) | ||
|
||
|
||
# MorseCode Encrypt | ||
async def morse_encrypt(msg: str): | ||
return str(await mk_morse_code.morse_encrypt(msg)) | ||
|
||
|
||
# MorseCode Decrypt | ||
async def morse_decrypt(msg: str): | ||
return str(await mk_morse_code.morse_decrypt(msg)) | ||
|
||
|
||
# NyaCode Encrypt | ||
async def nya_encode(msg: str): | ||
return str(await mk_nya_code.nya_encode(msg)) | ||
|
||
|
||
# NyaCode Decrypt | ||
async def nya_decode(msg: str): | ||
return str(await mk_nya_code.nya_decode(msg)) |
45 changes: 45 additions & 0 deletions
45
nonebot_plugin_marshoai/tools/marshoai_megakits/mk_Common.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "未知运算符" | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters