mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-01-26 18:12:47 +08:00
🎨 Apply black formatting
This commit is contained in:
parent
6f1817726e
commit
849cc24968
@ -16,10 +16,10 @@ repos:
|
|||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
|
|
||||||
# - repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
# rev: v4.0.1
|
rev: v4.0.1
|
||||||
# hooks:
|
hooks:
|
||||||
# - id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
# - id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
# - id: check-yaml
|
- id: check-yaml
|
||||||
# - id: check-added-large-files
|
- id: check-added-large-files
|
||||||
|
@ -14,7 +14,6 @@ async def random_turntable(upper: int, lower: int):
|
|||||||
return random.randint(lower, upper)
|
return random.randint(lower, upper)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async def number_calc(a: str, b: str, op: str) -> str:
|
async def number_calc(a: str, b: str, op: str) -> str:
|
||||||
"""Number Calc
|
"""Number Calc
|
||||||
|
|
||||||
@ -26,20 +25,19 @@ async def number_calc(a: str, b: str, op: str) -> str:
|
|||||||
Returns:
|
Returns:
|
||||||
str: _description_
|
str: _description_
|
||||||
"""
|
"""
|
||||||
a, b = float(a), float(b) # type: ignore
|
a, b = float(a), float(b) # type: ignore
|
||||||
match op:
|
match op:
|
||||||
case "+":
|
case "+":
|
||||||
return str(a + b) # type: ignore
|
return str(a + b) # type: ignore
|
||||||
case "-":
|
case "-":
|
||||||
return str(a - b) # type: ignore
|
return str(a - b) # type: ignore
|
||||||
case "*":
|
case "*":
|
||||||
return str(a * b) # type: ignore
|
return str(a * b) # type: ignore
|
||||||
case "/":
|
case "/":
|
||||||
return str(a / b) # type: ignore
|
return str(a / b) # type: ignore
|
||||||
case "**":
|
case "**":
|
||||||
return str(a**b) # type: ignore
|
return str(a**b) # type: ignore
|
||||||
case "%":
|
case "%":
|
||||||
return str(a % b)
|
return str(a % b)
|
||||||
case _:
|
case _:
|
||||||
return "未知运算符"
|
return "未知运算符"
|
||||||
|
|
@ -67,7 +67,7 @@ async def introduce(msg: str):
|
|||||||
from . import mg_search
|
from . import mg_search
|
||||||
|
|
||||||
context = await mg_search.search(msg, 1)
|
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}"')
|
logger.success(f'搜索完成, 打开"{keyword}"')
|
||||||
return await introduce(keyword)
|
return await introduce(keyword)
|
||||||
|
@ -4,7 +4,10 @@ dynamic = ["version"]
|
|||||||
description = "Nonebot2插件,调用Azure OpenAI等AI服务实现猫娘聊天"
|
description = "Nonebot2插件,调用Azure OpenAI等AI服务实现猫娘聊天"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = "<4.0,>=3.10"
|
requires-python = "<4.0,>=3.10"
|
||||||
authors = [{ name = "Asankilp", email = "asankilp@outlook.com" }]
|
authors = [
|
||||||
|
{ name = "Asankilp", email = "asankilp@outlook.com" },
|
||||||
|
{name="LiteyukiStudio", email = "support@liteyuki.icu"}
|
||||||
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nonebot2>=2.2.0",
|
"nonebot2>=2.2.0",
|
||||||
"nonebot-plugin-alconna>=0.48.0",
|
"nonebot-plugin-alconna>=0.48.0",
|
||||||
@ -56,4 +59,4 @@ dev = [
|
|||||||
"nonebot-adapter-onebot>=2.4.6",
|
"nonebot-adapter-onebot>=2.4.6",
|
||||||
"mypy>=1.13.0",
|
"mypy>=1.13.0",
|
||||||
"black>=24.10.0",
|
"black>=24.10.0",
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user