mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-01 03:59:51 +00:00
🎨 Apply black formatting
This commit is contained in:
@ -14,7 +14,6 @@ async def random_turntable(upper: int, lower: int):
|
||||
return random.randint(lower, upper)
|
||||
|
||||
|
||||
|
||||
async def number_calc(a: str, b: str, op: str) -> str:
|
||||
"""Number Calc
|
||||
|
||||
@ -26,20 +25,19 @@ async def number_calc(a: str, b: str, op: str) -> str:
|
||||
Returns:
|
||||
str: _description_
|
||||
"""
|
||||
a, b = float(a), float(b) # type: ignore
|
||||
a, b = float(a), float(b) # type: ignore
|
||||
match op:
|
||||
case "+":
|
||||
return str(a + b) # type: ignore
|
||||
return str(a + b) # type: ignore
|
||||
case "-":
|
||||
return str(a - b) # type: ignore
|
||||
return str(a - b) # type: ignore
|
||||
case "*":
|
||||
return str(a * b) # type: ignore
|
||||
return str(a * b) # type: ignore
|
||||
case "/":
|
||||
return str(a / b) # type: ignore
|
||||
return str(a / b) # type: ignore
|
||||
case "**":
|
||||
return str(a**b) # type: ignore
|
||||
return str(a**b) # type: ignore
|
||||
case "%":
|
||||
return str(a % b)
|
||||
case _:
|
||||
return "未知运算符"
|
||||
|
@ -67,7 +67,7 @@ async def introduce(msg: str):
|
||||
from . import mg_search
|
||||
|
||||
context = await mg_search.search(msg, 1)
|
||||
keyword = re.search(r".*?\n", context, flags=re.DOTALL).group()[:-1] # type: ignore
|
||||
keyword = re.search(r".*?\n", context, flags=re.DOTALL).group()[:-1] # type: ignore
|
||||
|
||||
logger.success(f'搜索完成, 打开"{keyword}"')
|
||||
return await introduce(keyword)
|
||||
|
Reference in New Issue
Block a user