Skip to content

Commit

Permalink
🎨 format
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Dec 8, 2023
1 parent 39fc9ad commit 006e31f
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 23 deletions.
6 changes: 3 additions & 3 deletions app/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ async def fill_font(route: Route, request: Request):
".footer p{margin:5px auto;}</style>"
'<div class="footer">'
f'<img align="right" src="data:image/png;base64,{b64}" />'
'<p>由 RaianBot 生成</p>'
'<br/>'
"<p>由 RaianBot 生成</p>"
"<br/>"
f'<p>{datetime.now().strftime("%Y/%m/%d %p %I:%M:%S")}</p>'
f'</div>'
f"</div>"
)

html_render = HTMLRenderer(
Expand Down
1 change: 0 additions & 1 deletion library/weibo/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import asyncio
from typing import Any, Literal

import aiohttp
Expand Down
6 changes: 5 additions & 1 deletion plugins/gacha/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ async def get_sim_gacha(per: int = 2, status: int = 0):

cmd = Alconna(
"抽卡",
Args["count", int, Field(10, completion=lambda: "试试输入 300", unmatch_tips=lambda x: f"预期参数为数字,而不是 {x}\n例如:/抽卡 100")],
Args[
"count",
int,
Field(10, completion=lambda: "试试输入 300", unmatch_tips=lambda x: f"预期参数为数字,而不是 {x}\n例如:/抽卡 100"), # noqa: E501
],
Option("更新", help_text="卡池更新"),
meta=CommandMeta("模拟方舟寻访", example="$抽卡 300", extra={"supports": {"mirai", "qqapi"}}),
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/help/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Field(
-1,
completion=lambda: f"试试 {random.randint(0, len(command_manager.get_commands()))}",
unmatch_tips=lambda x: f"预期输入为某个命令的id或者名称,而不是 {x}\n例如:/帮助 0"
unmatch_tips=lambda x: f"预期输入为某个命令的id或者名称,而不是 {x}\n例如:/帮助 0",
),
],
meta=CommandMeta("查看帮助", extra={"supports": {"mirai", "qqapi"}}),
Expand Down
8 changes: 6 additions & 2 deletions plugins/query_record/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pathlib import Path
from secrets import token_hex

from arclet.alconna import Alconna, Arg, Args, Arparma, CommandMeta, Option, Field
from arclet.alconna import Alconna, Arg, Args, Arparma, CommandMeta, Field, Option
from arclet.alconna.graia import Match, alcommand, assign
from arknights_toolkit.images import update_operators
from arknights_toolkit.record import ArkRecord
Expand All @@ -17,7 +17,11 @@
alc = Alconna(
"抽卡查询",
Args["count#最近x抽", int, -1],
Option("绑定", Args[Arg("token", str, Field(unmatch_tips=lambda x: f"请输入您的凭证,而不是{x}"), seps="\n")], compact=True),
Option(
"绑定",
Args[Arg("token", str, Field(unmatch_tips=lambda x: f"请输入您的凭证,而不是{x}"), seps="\n")],
compact=True, # noqa: E501
),
Option("更新", Args["name?#卡池名", str]["limit", bool, True]),
meta=CommandMeta(
"明日方舟抽卡数据查询,数据来源为方舟官网",
Expand Down
6 changes: 5 additions & 1 deletion plugins/random_operator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
@alcommand(
Alconna(
"测试干员",
Args["name?#你的代号", [str, Notice], Field(completion=lambda: "你的代号是?", unmatch_tips=lambda x: f"输入的应该是名字或者 @提及某人,而不是 {x}")],
Args[
"name?#你的代号",
[str, Notice],
Field(completion=lambda: "你的代号是?", unmatch_tips=lambda x: f"输入的应该是名字或者 @提及某人,而不是 {x}"), # noqa: E501
],
meta=CommandMeta(
"依据名字测试你会是什么干员",
example="$测试干员 海猫",
Expand Down
6 changes: 5 additions & 1 deletion plugins/recruitment/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

cmd = Alconna(
"公招",
Args["tags", MultiVar(str, "*"), Field(completion=lambda: "高资", unmatch_tips=lambda x: f"输入的应该是公招标签,而不是{x}\n例如:/公招 高资")],
Args[
"tags",
MultiVar(str, "*"),
Field(completion=lambda: "高资", unmatch_tips=lambda x: f"输入的应该是公招标签,而不是{x}\n例如:/公招 高资"),
],
meta=CommandMeta(
"自助访问 prts 的公招计算器并截图",
usage="标签之间用空格分隔",
Expand Down
2 changes: 1 addition & 1 deletion plugins/sk_autosign/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from datetime import datetime
from secrets import token_hex

from arclet.alconna import Alconna, Args, CommandMeta, Option, Field
from arclet.alconna import Alconna, Args, CommandMeta, Field, Option
from arclet.alconna.graia import Match, alcommand, assign
from avilla.core import ActionFailed, Avilla, Context, Picture, RawResource
from avilla.elizabeth.account import ElizabethAccount
Expand Down
4 changes: 1 addition & 3 deletions plugins/weather/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@

if config.heweather and bot.config.platform.heweather_api_key and bot.config.platform.heweather_api_type:
heweather = HeWeather(
bot.config.platform.heweather_api_key,
bot.config.platform.heweather_api_type,
bot.config.proxy
bot.config.platform.heweather_api_key, bot.config.platform.heweather_api_type, bot.config.proxy
)
cache_dir = Path(bot.config.data_dir) / "plugins" / "weather"
cache_dir.mkdir(parents=True, exist_ok=True)
Expand Down
14 changes: 5 additions & 9 deletions plugins/weibo/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import contextlib
import random
from secrets import token_hex

Expand Down Expand Up @@ -44,18 +43,15 @@
weibo_fetch = Alconna(
"微博",
Arg(
"user;?#微博用户名称",
str,
Field(
completion=lambda: "比如说, 育碧",
unmatch_tips=lambda x: f"请输入微博用户名称,而不是{x}\n例如: /微博 育碧"
)
"user;?#微博用户名称",
str,
Field(completion=lambda: "比如说, 育碧", unmatch_tips=lambda x: f"请输入微博用户名称,而不是{x}\n例如: /微博 育碧"), # noqa: E501
),
Arg("select#选择第几个用户", int, Field(default=-1, unmatch_tips=lambda x: f"请输入数字,而不是{x}")),
Option(
"动态",
Arg("index#从最前动态排起的第几个动态", int, Field(default=-1, unmatch_tips=lambda x: f"请输入数字,而不是{x}")) +
Arg("page#第几页动态", int, Field(default=1, unmatch_tips=lambda x: f"请输入数字,而不是{x}")),
Arg("index#从最前动态排起的第几个动态", int, Field(default=-1, unmatch_tips=lambda x: f"请输入数字,而不是{x}"))
+ Arg("page#第几页动态", int, Field(default=1, unmatch_tips=lambda x: f"请输入数字,而不是{x}")),
help_text="从微博获取指定用户的动态",
),
Option("关注|增加关注", dest="follow", help_text="增加一位微博动态关注对象"),
Expand Down

0 comments on commit 006e31f

Please sign in to comment.