diff --git a/.env.example b/.env.example index e6d812e..561ee96 100644 --- a/.env.example +++ b/.env.example @@ -40,7 +40,7 @@ OWNER=0 # VERIFY_GROUPS=[] # logger 配置 可选配置项 -# LOGGER_NAME="TGPaimon" +# LOGGER_NAME="HonkaiStarRailGram" # 打印时的宽度 # LOGGER_WIDTH=180 # log 文件存放目录 @@ -80,12 +80,11 @@ LOGGER_FILTERED_NAMES=["uvicorn","ErrorPush","ApiHelper"] # API_ID=12345 # API_HASH="abcdefg" -# ENKA_NETWORK_API 可选配置项 +# ENKA_NETWORK_API 可选配置项(暂时无法使用) # ENKA_NETWORK_API_AGENT="" # Web Server -# WEB_SWITCH=False # 是否开启 -# WEB_URL=http://localhost:8080/ +# WEB_ENABLE=False # 是否开启 WebServer # WEB_HOST=localhost # WEB_PORT=8080 diff --git a/.gitignore b/.gitignore index 15b2e0a..5c7ce6e 100644 --- a/.gitignore +++ b/.gitignore @@ -139,6 +139,7 @@ data/ plugins/genshin/daily/daily.json metadata/data/ resources/assets/ +run.ps1 ### private plugins ### plugins/private diff --git a/README.md b/README.md index bc1b9c6..ea10d3b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ 基于 [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) 的 PaiGram - ![Alt](https://repobeats.axiom.co/api/embed/f73c1121006cb86196f83da2170242b7a97f8be0.svg "Repobeats analytics image") ## 环境需求 @@ -37,6 +36,10 @@ poetry install poetry run playwright install chromium ``` +```bash +pip install git+https://github.com/PaiGramTeam/genshin.py@sr +``` + #### 可选依赖项 ```bash diff --git a/alembic/versions/ddcfba3c7d5c_v4.py b/alembic/versions/ddcfba3c7d5c_v4.py index 396bbfe..4630a9c 100644 --- a/alembic/versions/ddcfba3c7d5c_v4.py +++ b/alembic/versions/ddcfba3c7d5c_v4.py @@ -193,7 +193,7 @@ def upgrade() -> None: ) try: - statement = "SELECT * FROM admin;" + statement = "SELECT * FROM `admin`;" old_user_table_data = connection.execute(text(statement)) except NoSuchTableError: logger.warning("Table 'admin' doesn't exist") diff --git a/resources/starrail/gacha_log/gacha_log.css b/resources/starrail/gacha_log/gacha_log.css index ac2d806..caa02e2 100644 --- a/resources/starrail/gacha_log/gacha_log.css +++ b/resources/starrail/gacha_log/gacha_log.css @@ -1,341 +1,342 @@ @font-face { - font-family: "tttgbnumber"; - src: url("./../../fonts/tttgbnumber.ttf"); - font-weight: normal; - font-style: normal; + font-family: "tttgbnumber"; + src: url("./../../fonts/tttgbnumber.ttf"); + font-weight: normal; + font-style: normal; } -* { - margin: 0; - padding: 0; - box-sizing: border-box; - user-select: none; +.header { + background: #e0dad3 url(./img/starrail.png) no-repeat right; + box-shadow: 0 0 8px #72a2ae79; +} + +.frame { + border-color: #cdbea8; } body { - font-size: 18px; - color: #1e1f20; - font-family: PingFangSC-Medium, PingFang SC, sans-serif; - transform: scale(1.5); - transform-origin: 0 0; - width: 510px; + font-size: 18px; + color: #1e1f20; + font-family: PingFangSC-Medium, PingFang SC, sans-serif; + transform: scale(1.5); + transform-origin: 0 0; + width: 510px; } .container { - width: 510px; - padding: 20px 15px 10px 15px; - background-color: #f5f6fb; + width: 510px; + padding: 20px 15px 10px 15px; + background-color: #f5f6fb; } .head_box { - border-radius: 9999px; - font-family: tttgbnumber, sans-serif; - padding: 10px 20px; - position: relative; - box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); + border-radius: 9999px; + font-family: tttgbnumber, sans-serif; + padding: 10px 20px; + position: relative; + box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); } .head_box .id_text { - font-size: 24px; + font-size: 24px; } .head_box .day_text { - font-size: 20px; + font-size: 20px; } .head_box .starrail_logo { - position: absolute; - top: 10px; - right: 30px; - width: 120px; + position: absolute; + top: 10px; + right: 30px; + width: 120px; } .logo { - font-size: 12px; - font-family: "tttgbnumber", serif; - text-align: center; - color: #7994a7; - position: relative; - padding-left: 10px; + font-size: 12px; + font-family: "tttgbnumber", serif; + text-align: center; + color: #7994a7; + position: relative; + padding-left: 10px; } .data_box { - border-radius: 15px; - margin-top: 20px; - margin-bottom: 10px; - padding: 20px 0 5px 10px; - background: #fff; - box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); - position: relative; + border-radius: 15px; + margin-top: 20px; + margin-bottom: 10px; + padding: 20px 0 5px 10px; + background: #fff; + box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); + position: relative; } .tab_lable { - position: absolute; - top: -10px; - left: -8px; - background: #d4b98c; - color: #fff; - font-size: 14px; - padding: 3px 10px; - border-radius: 15px 0 15px 15px; - z-index: 20; + position: absolute; + top: -10px; + left: -8px; + background: #d4b98c; + color: #fff; + font-size: 14px; + padding: 3px 10px; + border-radius: 15px 0 15px 15px; + z-index: 20; } .data_line { - display: flex; - justify-content: space-around; - margin-bottom: 14px; - padding-right: 10px; + display: flex; + justify-content: space-around; + margin-bottom: 14px; + padding-right: 10px; } .data_line_item { - width: 100px; - text-align: center; + width: 100px; + text-align: center; - /* margin: 0 20px; */ + /* margin: 0 20px; */ } .num { - font-family: tttgbnumber, serif; - font-size: 24px; + font-family: tttgbnumber, serif; + font-size: 24px; } .num .unit { - font-size: 12px; + font-size: 12px; } .data_box .lable { - font-size: 14px; - color: #7f858a; - line-height: 1; - margin-top: 3px; + font-size: 14px; + color: #7f858a; + line-height: 1; + margin-top: 3px; } .info_box_border { - border-radius: 15px; + border-radius: 15px; - /* margin-top: 20px; */ - margin-bottom: 20px; - padding: 6px 0 5px 10px; - background: #fff; - box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); - position: relative; + /* margin-top: 20px; */ + margin-bottom: 20px; + padding: 6px 0 5px 10px; + background: #fff; + box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%); + position: relative; } .card_list { - display: flex; - flex-wrap: wrap; - justify-content: flex-start; + display: flex; + flex-wrap: wrap; + justify-content: flex-start; } .card_list .item { - margin: 0 8px 10px 0; - border-radius: 7px; - box-shadow: 0 2px 6px 0 rgb(132 93 90 / 30%); - height: 90px; - position: relative; - overflow: hidden; - background: #e7e5d9; + margin: 0 8px 10px 0; + border-radius: 7px; + box-shadow: 0 2px 6px 0 rgb(132 93 90 / 30%); + height: 90px; + position: relative; + overflow: hidden; + background: #e7e5d9; } .card_list .item img { - width: 70px; - height: 70px; - border-radius: 7px 7px 20px 0; + width: 70px; + height: 70px; + border-radius: 7px 7px 20px 0; } .card_list .item.star5 img { - background-image: url(./../../genshin/abyss/background/roleStarBg5.png); - width: 100%; - height: 70px; - /* filter: brightness(1.1); */ - background-size: 100%; - background-repeat: no-repeat; + background-image: url(./../../genshin/abyss/background/roleStarBg5.png); + width: 100%; + height: 70px; + /* filter: brightness(1.1); */ + background-size: 100%; + background-repeat: no-repeat; } .card_list .item.star4 img { - width: 100%; - height: 70px; - background-image: url(./../../genshin/abyss/background/roleStarBg4.png); - background-size: 100%; - background-repeat: no-repeat; + width: 100%; + height: 70px; + background-image: url(./../../genshin/abyss/background/roleStarBg4.png); + background-size: 100%; + background-repeat: no-repeat; } .card_list .item .num { - position: absolute; - top: 0; - right: 0; - z-index: 9; - font-size: 18px; - text-align: center; - color: #fff; - border-radius: 3px; - padding: 1px 5px; - background: rgb(0 0 0 / 50%); - font-family: "tttgbnumber", serif; + position: absolute; + top: 0; + right: 0; + z-index: 9; + font-size: 18px; + text-align: center; + color: #fff; + border-radius: 3px; + padding: 1px 5px; + background: rgb(0 0 0 / 50%); + font-family: "tttgbnumber", serif; } .card_list .item .name, .card_list .item .num_name { - position: absolute; - top: 71px; - left: 0; - z-index: 9; - font-size: 12px; - text-align: center; - width: 100%; - height: 16px; - line-height: 18px; + position: absolute; + top: 71px; + left: 0; + z-index: 9; + font-size: 12px; + text-align: center; + width: 100%; + height: 16px; + line-height: 18px; } .card_list .item .num_name { - font-family: "tttgbnumber", serif; - font-size: 16px; + font-family: "tttgbnumber", serif; + font-size: 16px; } .base_info { - position: relative; - padding-left: 10px; - margin: 5px 10px; + position: relative; + padding-left: 10px; + margin: 5px 10px; } .uid::before { - content: " "; - position: absolute; - width: 5px; - height: 24px; - border-radius: 1px; - left: 0; - top: 0; - background: #d3bc8d; + content: " "; + position: absolute; + width: 5px; + height: 24px; + border-radius: 1px; + left: 0; + top: 0; + background: #d3bc8d; } .label_301 { - background-color: rgb(235 106 75); + background-color: rgb(235 106 75); } .label_302 { - background-color: #e69449; + background-color: #e69449; } .label_200 { - background-color: #757cc8; + background-color: #757cc8; } .label { - color: #fff; - border-radius: 10px; - font-size: 12px; - padding: 2px 7px; - vertical-align: 2px; + color: #fff; + border-radius: 10px; + font-size: 12px; + padding: 2px 7px; + vertical-align: 2px; } .ritem { - display: flex; - font-size: 12px; - margin-bottom: 5px; + display: flex; + font-size: 12px; + margin-bottom: 5px; } .info_role { - display: flex; - flex-wrap: wrap; - padding: 0 0 5px 9px; + display: flex; + flex-wrap: wrap; + padding: 0 0 5px 9px; } .ritem .role { - width: 20px; - height: 20px; - background-color: #ffb285; - border-radius: 100%; + width: 20px; + height: 20px; + background-color: #ffb285; + border-radius: 100%; } .ritem .weapon_box { - overflow: hidden; - width: 20px; - height: 20px; - border-radius: 100%; + overflow: hidden; + width: 20px; + height: 20px; + border-radius: 100%; } .ritem .weapon { - width: 20px; - height: 20px; - background-color: #ffb285; - border-radius: 100%; - transform: scale(1.5); - -webkit-transform: scale(1.5); - + width: 20px; + height: 20px; + background-color: #ffb285; + border-radius: 100%; + transform: scale(1.5); + -webkit-transform: scale(1.5); } .ritem .role_text { - margin: 2px 3px 0 2px; - display: flex; - align-items: baseline; + margin: 2px 3px 0 2px; + display: flex; + align-items: baseline; } .ritem .role_name { - width: 24px; - white-space: nowrap; - overflow: hidden; + width: 24px; + white-space: nowrap; + overflow: hidden; } .ritem .role_num { - width: 24px; + width: 24px; } .line_box { - height: 32px; - width: 100%; - display: flex; - justify-content: space-between; - align-items: center; - font-size: 12px; - color: #7d7d7d; - padding-bottom: 5px; + height: 32px; + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 12px; + color: #7d7d7d; + padding-bottom: 5px; } .line_box .line { - height: 2px; - flex-grow: 1; - background-color: #ebebeb; - margin: 0 10px; + height: 2px; + flex-grow: 1; + background-color: #ebebeb; + margin: 0 10px; } .red { - color: #f21000; + color: #f21000; } .orange { - color: #ff8d00; + color: #ff8d00; } .green { - color: #12d88c; + color: #12d88c; } .blue { - color: #4169e1; + color: #4169e1; } .purple { - color: #7500ff; + color: #7500ff; } .minimum { - position: absolute; - top: 0; - right: 0; - z-index: 9; - font-size: 12px; - text-align: center; - color: #fff; - border-radius: 3px; - padding: 1px 3px; - background-color: rgb(0 0 0 / 80%); - font-family: "tttgbnumber", serif; + position: absolute; + top: 0; + right: 0; + z-index: 9; + font-size: 12px; + text-align: center; + color: #fff; + border-radius: 3px; + padding: 1px 3px; + background-color: rgb(0 0 0 / 80%); + font-family: "tttgbnumber", serif; } .hasMore { - font-size: 12px; - margin: 6px 0; - color: #7f858a; + font-size: 12px; + margin: 6px 0; + color: #7f858a; } diff --git a/resources/starrail/gacha_log/gacha_log.html b/resources/starrail/gacha_log/gacha_log.html index 0054386..f5e0dc6 100644 --- a/resources/starrail/gacha_log/gacha_log.html +++ b/resources/starrail/gacha_log/gacha_log.html @@ -1,88 +1,80 @@ - - - - - - - - - - - - -
-
- -
-
- ID: {{ uid }} -
-

- {{ allNum }}抽 - {{ typeName }} + + + + + + + Title + + +
+
+
+
+

ID: {{ uid }}

+

+ {{ allNum }}抽 + {{ typeName }}

- +
-
数据总览
- {% for val in line %} -
- {% for item in val %} -
-
{{item.num}}{{item.unit}}
-
{{item.lable}}
-
- {% endfor %} +
数据总览
+ {% for val in line %} +
+ {% for item in val %} +
+
+ {{item.num}}{{item.unit}} +
+
{{item.lable}}
{% endfor %} +
+ {% endfor %} -
- - 五星历史 {{firstTime}} ~ {{lastTime}} - +
+ + 五星历史 {{firstTime}} ~ {{lastTime}} + +
+ +
+ {% for val in fiveLog %} +
+ {% if val.isUp %} + UP + {% endif %} + + +
{{ val.count }}
+ {% endfor %} +
+
+ + 四星最近历史 + +
-
- {% for val in fiveLog %} -
- {% if val.isUp %} - UP - {% endif %} - - -
{{ val.count }}
-
- {% endfor %} -
- -
- - 四星最近历史 - -
- -
- {% for val in fourLog %} -
- - -
{{ val.count }}
-
- {% endfor %} +
+ {% for val in fourLog %} +
+ + +
{{ val.count }}
+ {% endfor %} +
- + +
-
- - \ No newline at end of file + + diff --git a/resources/starrail/gacha_log/img/starrail.png b/resources/starrail/gacha_log/img/starrail.png new file mode 100644 index 0000000..b7451eb Binary files /dev/null and b/resources/starrail/gacha_log/img/starrail.png differ diff --git a/resources/starrail/stats/items/star.png b/resources/starrail/stats/items/star.png new file mode 100644 index 0000000..1c7498b Binary files /dev/null and b/resources/starrail/stats/items/star.png differ diff --git a/resources/starrail/stats/stats.html b/resources/starrail/stats/stats.html index 68468ea..7850e15 100644 --- a/resources/starrail/stats/stats.html +++ b/resources/starrail/stats/stats.html @@ -13,18 +13,25 @@
-
-
-

- {{ info.nickname }} - lv.{{ info.level }} -

-

UID - {{ uid }}

+
+
+
+

+ {{ info.nickname }} + lv.{{ info.level }} +

+

UID - {{ uid }}

+
-
-
-

+
+
+

+ 数据总览

@@ -35,10 +42,10 @@
{% endfor %}
-
-
- 所有数据会有一小时延迟 以游戏内为准 此处仅供参考 +
+ 所有数据会有一小时延迟 以游戏内为准 此处仅供参考 +

diff --git a/resources/starrail/stats/xianzhou.css b/resources/starrail/stats/xianzhou.css index 755f6b6..cb7b706 100644 --- a/resources/starrail/stats/xianzhou.css +++ b/resources/starrail/stats/xianzhou.css @@ -1,49 +1,56 @@ body { - background-color: #f5f6fb; + background-color: #f5f6fb; } .header { - background-image: url(../../bot/help/background/header.png); - box-shadow: 0 0 8px rgb(123 242 248 / 50%); + background-image: url(../../bot/help/background/header.png); + box-shadow: 0 0 8px #72a2ae79; } .box { - background-color: #fdfdf3; - box-shadow: 0 0 8px rgb(123 242 248 / 50%); -} - -.box-title { - background-color: #43849abb; - --tw-ring-color: #43849a; + background-color: #f4f2e4; + box-shadow: 0 0 8px #72a2ae79; } .pointer-bar { - width: 95%; - height: 8px; - display: inline-block; - background-color: rgb(0, 0, 0, 0.2); - border-radius: 0.25rem; + width: 95%; + height: 8px; + display: inline-block; + background-color: rgb(0, 0, 0, 0.2); + border-radius: 0.25rem; } .pointer-progress-bar { - border-radius: 0.25rem; - height: 100%; - background: #fff6e2; + border-radius: 0.25rem; + height: 100%; + background: #fff6e2; } .name { - background: linear-gradient(to bottom, #FFFFEE, #FFEEFF, #EEFFFF); - background-clip: text; - -webkit-background-clip: text; - color: transparent; + color: #ffffee; + text-shadow: 0 0.08em 0.1em #00000093, 0 0.1em 0.3em rgba(0, 0, 0, 0.4); } .uid { - color: #fff; - background: linear-gradient(to right, rgb(0, 0, 0, 0), #5ddddd, rgb(0, 0, 0, 0)); + color: #fff; + background: linear-gradient( + to right, + rgb(0, 0, 0, 0), + #3f7587 25%, + #3f7587 75%, + rgb(0, 0, 0, 0) + ); } .about { - background-color: #e0dad3; - color: #8a4d30; + background-color: #e0dad3; + color: #8a4d30; +} + +.frame-pic { + border-color: #fdfdf356; +} + +.frame { + border-color: #cdbea8; }