Skip to content

Commit c4bdc7b

Browse files
style(groupManaging&configuration): rename 30 × 24 × 60 × 60 (2591940 const) to python const, tip configuration.
1 parent 835da97 commit c4bdc7b

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

data/configuration_template.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ api_key = "your-api-key" # API密钥
1313
name = ""
1414
base_url = ""
1515
api_key = ""
16-
16+
# 所有空白部分上线时均需删除
1717

1818
[[models]] # 模型(可以配置多个)
1919
model_identifier = "deepseek-ai/DeepSeek-V3" # 模型标识符(API服务商提供的模型标识符)
@@ -23,4 +23,5 @@ api_provider = "SiliconFlow" # API服务商名称(对应在api_providers
2323
[[models]] #自定义模型配置
2424
model_identifier = ""
2525
name = ""
26-
api_provider = ""
26+
api_provider = ""
27+
# 所有空白部分上线时均需删除

plugins/groupManagingController/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from toolsbot.configs import DATA_PATH
2424
from toolsbot.services import _crit, _info, _warn
2525

26+
THIRTY_DAYS_BAN = 2591940 # 30 * 24 * 60 * 60
2627
cfg_path = DATA_PATH / "configuration.toml"
2728

2829
with open(cfg_path, "r", encoding="utf-8") as f:
@@ -71,7 +72,7 @@ async def welcome(bot: nonebot.adapters.onebot.v11.Bot, event: GroupIncreaseNoti
7172
# check if it in banned, auto ban
7273
if dc.User(user).banned:
7374
try:
74-
await bot.call_api("set_group_ban", group_id=event.group_id, user_id = user, duration=2591940)
75+
await bot.call_api("set_group_ban", group_id=event.group_id, user_id = user, duration=THIRTY_DAYS_BAN)
7576
except ActionFailed:
7677
_crit("Failed to auto ban a sb.")
7778

0 commit comments

Comments
 (0)