Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
DoroWolf committed Dec 29, 2024
1 parent e2ebace commit 791c34a
Show file tree
Hide file tree
Showing 52 changed files with 495 additions and 315 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker-build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Docker Build and Publish
name: "Docker Build and Publish (3:00, UTC+8)"

on:
push:
branches: [master]

schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Nightly Build and Release (3:00, UTC+8)"

on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:

permissions:
contents: write

jobs:
nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Delete and recreate nightly tag
run: |
if git rev-parse refs/tags/nightly >/dev/null 2>&1; then
git tag -d nightly
git push origin --delete nightly
fi
git tag nightly
git push origin nightly
- name: Update release version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
release_exists=$(gh release list --json tagName --jq '.[] | select(.tagName=="nightly") | .tagName')
if [ -n "$release_exists" ]; then
gh release delete nightly -y
fi
gh release create nightly \
--title "Nightly Release" \
--notes "> 这是 Nightly 版本,由于无法及时同步代码和验证版本的稳定性,本项目已不再提供正式版本。请点击 Assets -> Source code 下载当前最新源代码。"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ config/*.toml*
test*
*.db
cache/*
assets/arcaea*
assets/maimai*
assets/modules/arcaea
assets/arc.apk
assets/modules/maimai*
!assets/modules/maimai/mai_utage_info.json
!assets/modules/maimai/mai_grade_info.json
Expand Down
12 changes: 1 addition & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,4 @@ repos:
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: "v2.0.4"
hooks:
- id: autopep8

- repo: local
hooks:
- id: auto-generate-config
name: Auto-generate config
entry: poetry run python ./core/scripts/config_generate.py
language: python
pass_filenames: false


- id: autopep8
4 changes: 3 additions & 1 deletion assets/config_store/en_us/bot_api.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

[bot_api_secret]
# The secret config section of the platform. The bot will try to intercept if the value here accidentally appears in the message sent, but be careful to prevent leakage.
jwt_secret = "<Replace me with str value>" # The authentication key for the built-in API, it can be filled in at will.
api_access_token = "<Replace me with str value>" # Access Token used to request the API service.
api_allow_origins = ["*"] # The API service allows CORS sources list.
jwt_secret = "<Replace me with str value>" # The authentication key for the built-in API, for signing and verifying validity.

[bot_api]
# The basic config section of the platform. The value ​​filled in here can be displayed in the message. Please do not fill in sensitive information in this section.
Expand Down
2 changes: 1 addition & 1 deletion assets/config_store/en_us/bot_qqbot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The basic config section of the platform. The value ​​filled in here can be displayed in the message. Please do not fill in sensitive information in this section.
qq_bot_appid = "<Replace me with (int, str) value>" # The QQ official robot AppID.
enable = false # Whether to enable this platform.
qq_private_bot = false # Whether it is a private robot when using the QQ official robot.
qq_private_bot = false # Whether it is a private robot when using the QQ official bot.
qq_bot_enable_send_url = false # Whether to enable sending URLs when using QQ official robot.
qq_typing_emoji = 181 # When using QQ related protocol terminals, the response emoji ID attached to the message when processing the message. It needs to be supported by the protocol terminal. For details of emoji ID, see: https://bot.q.qq.com/wiki/develop/api/openapi/emoji/model.html#Emoji

Expand Down
4 changes: 2 additions & 2 deletions assets/config_store/en_us/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dice_output_len = 200 # The maximum length output of dice module.
dice_roll_limit = 10 # The maximum number of dice rolled per command of dice module.
dice_detail_count = 5 # The total number of dice rolled n times of dice module, it will no longer show details when this value is exceeded.
dice_count_limit = 10 # The maximum number of items in dice expressions of dice module.
ncmusic_enable_card = false # Whether enables card messages of ncmusic module. (Only valid on QQ platform)
ncmusic_enable_card = false # Whether enables card messages of ncmusic module. (Only valid on QQ client)
wiki_whitelist_url = "<Replace me with str value>" # Wiki whitelist application URL.
wordle_disable_image = false # Whether to disable images of wordle module.
slower_schedule = false # Whether to enable a slower scheduled task scheduler. (To reduce request pressure)
Expand All @@ -77,4 +77,4 @@ wolfram_alpha_appid = "<Replace me with str value>" # WolframAlpha AppID. (For w
diving_fish_developer_token = "<Replace me with str value>" # Developer token for Diving Fish prober. (For maimai module)
curseforge_api_key = "<Replace me with str value>" # CurseForge API key. (For mod_dl module)
ncmusic_api = "<Replace me with str value>" # API address of NetEase Cloud Music API. (For ncmusic module)
osu_api_key = "<Replace me with str value>" # osu! API Key (for osu module)
osu_api_key = "<Replace me with str value>" # Osu! API Key (for osu module)
4 changes: 3 additions & 1 deletion assets/config_store/zh_cn/bot_api.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

[bot_api_secret]
# 平台端的密钥配置部分,此处的值若意外出现在发送的消息中,机器人会尝试拦截。但请务必提防泄露。
jwt_secret = "<Replace me with str value>" # 内置 API 的认证密钥,随意填写即可。
api_access_token = "<Replace me with str value>" # 请求 API 服务的 Access Token。
api_allow_origins = ["*"] # API 服务允许 CORS 的源列表。
jwt_secret = "<Replace me with str value>" # 内置 API 的身份认证密钥,用于签名和验证有效性。

[bot_api]
# 平台端的配置部分,此处填写的值可在消息中以明文形式展示。请不要在此部分填写敏感信息。
Expand Down
2 changes: 1 addition & 1 deletion assets/config_store/zh_cn/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ dice_output_len = 200 # dice 模块输出最大长度。
dice_roll_limit = 10 # dice 模块一次命令投掷次数上限。
dice_detail_count = 5 # dice 模块 n 次投掷的骰子的总量超过该值时将不再显示详细信息。
dice_count_limit = 10 # dice 模块骰子表达式项数上限。
ncmusic_enable_card = false # ncmusic 模块是否启用卡片消息。(仅在 QQ 平台有效
ncmusic_enable_card = false # ncmusic 模块是否启用卡片消息。(仅在 QQ 客户端有效
wiki_whitelist_url = "<Replace me with str value>" # Wiki 白名单申请网址。
wordle_disable_image = false # wordle 模块是否禁用图片。
slower_schedule = false # 是否启用更慢的计划任务调度器。(减少请求压力用)
Expand Down
4 changes: 3 additions & 1 deletion assets/config_store/zh_tw/bot_api.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

[bot_api_secret]
# 平台端的金鑰設定部分,此處的值若意外出現在傳送的訊息中,機器人會嘗試攔截。但請務必提防洩漏。
jwt_secret = "<Replace me with str value>" # 內建 API 的認證金鑰,隨意填寫即可。
api_access_token = "<Replace me with str value>" # 請求 API 服務的 Access Token。
api_allow_origins = ["*"] # API 服務允许 CORS 的來源列表。
jwt_secret = "<Replace me with str value>" # 內建 API 的身份認證金鑰,用於簽署和驗證有效性。

[bot_api]
# 平台端的設定部分,此處填寫的值可在訊息中以明文顯示。請不要在此部分填寫敏感資訊。
Expand Down
4 changes: 2 additions & 2 deletions assets/config_store/zh_tw/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enable_get_petal = false # 是否允許取得花瓣。
gained_petal_limit = 0 # 單日取得花瓣上限。
lost_petal_limit = 0 # 單日失去花瓣上限。
use_secrets_random = false # 是否使用基於 secrets 庫的隨機數產生器。
web_render_local = "<Replace me with str value>" # 本地 WebRender 位址
web_render_local = "<Replace me with str value>" # 本地 WebRender 服務位址
enable_langsmith = "<Replace me>"
langsmith_endpoint = "<Replace me>"
langsmith_project = "<Replace me>"
Expand All @@ -57,7 +57,7 @@ dice_output_len = 200 # dice 模組輸出最大長度。
dice_roll_limit = 10 # dice 模組一次指令投擲次數上限。
dice_detail_count = 5 # dice 模組 n 次投擲的骰子的總量超過該值時將不再顯示詳細資訊。
dice_count_limit = 10 # dice 模組骰子表示式項數上限。
ncmusic_enable_card = false # ncmusic 模組是否啟用卡片訊息。(僅在 QQ 平台有效
ncmusic_enable_card = false # ncmusic 模組是否啟用卡片訊息。(僅在 QQ 用戶端有效
wiki_whitelist_url = "<Replace me with str value>" # Wiki 白名單申請網址。
wordle_disable_image = false # wordle 模組是否停用圖片。
slower_schedule = false # 是否啟用更慢的排程任務調度器。(減少請求壓力用)
Expand Down
Binary file modified assets/config_store_packed/en_us.zip
Binary file not shown.
Binary file modified assets/config_store_packed/zh_cn.zip
Binary file not shown.
Binary file modified assets/config_store_packed/zh_tw.zip
Binary file not shown.
Binary file added assets/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"aiogram": ["telegram_token"],
"kook": ["kook_token"],
"matrix": ["matrix_homeserver", "matrix_user", "matrix_device_id", "matrix_token"],
"api": [],
"api": ["jwt_secret", "api_allow_origins"],
"qqbot": ["qq_bot_appid", "qq_bot_secret"],
}

Expand Down Expand Up @@ -98,7 +98,7 @@ def multiprocess_run_until_complete(func):
p.close()


def go(bot_name: str = None, subprocess: bool = False, binary_mode: bool = False):
def go(bot_name: str, subprocess: bool = False, binary_mode: bool = False):
from core.logger import Logger # noqa
from core.utils.info import Info # noqa

Expand Down
Loading

0 comments on commit 791c34a

Please sign in to comment.