From 99719eb146f5eba82189edf3fd83012072681cc3 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Thu, 12 Mar 2026 01:19:21 -0400 Subject: [PATCH] [M] Organize files --- analysis.py => src/analysis.py | 0 bot.py => src/bot.py | 5 +++-- bot_disabled.py => src/bot_disabled.py | 0 db.py => src/db.py | 0 gen_static.py => src/gen_static.py | 0 gentree.py => src/gentree.py | 0 utils.py => src/utils.py | 0 7 files changed, 3 insertions(+), 2 deletions(-) rename analysis.py => src/analysis.py (100%) rename bot.py => src/bot.py (98%) rename bot_disabled.py => src/bot_disabled.py (100%) rename db.py => src/db.py (100%) rename gen_static.py => src/gen_static.py (100%) rename gentree.py => src/gentree.py (100%) rename utils.py => src/utils.py (100%) diff --git a/analysis.py b/src/analysis.py similarity index 100% rename from analysis.py rename to src/analysis.py diff --git a/bot.py b/src/bot.py similarity index 98% rename from bot.py rename to src/bot.py index 0354e3f..3115ce7 100644 --- a/bot.py +++ b/src/bot.py @@ -142,7 +142,7 @@ async def plant(update: Update, context: ContextTypes.DEFAULT_TYPE): validating.add(sha) else: logger.info(f"> Channel not validated, asking again for validation.") - await update.message.reply_text("(看了一下好像频道信息还没有更新的样子... 确定加上了吗?再试试吧)") + return await update.message.reply_text("(看了一下好像频道信息还没有更新的样子... 确定加上了吗?再试试吧)") async def water_callback(update: Update, context: ContextTypes.DEFAULT_TYPE): @@ -204,7 +204,8 @@ async def treehole_callback(update: Update, context: ContextTypes.DEFAULT_TYPE): ) user_states[user_id] = {"action": "treehole", "channel": channel} await query.answer("请查看 bot 的私聊~", show_alert=False) - except Exception: + except Exception as e: + logger.error(f"Failed to send treehole message: {e}") await query.answer("请先私聊 bot 发送 /start 才能使用树洞功能哦~", show_alert=True) diff --git a/bot_disabled.py b/src/bot_disabled.py similarity index 100% rename from bot_disabled.py rename to src/bot_disabled.py diff --git a/db.py b/src/db.py similarity index 100% rename from db.py rename to src/db.py diff --git a/gen_static.py b/src/gen_static.py similarity index 100% rename from gen_static.py rename to src/gen_static.py diff --git a/gentree.py b/src/gentree.py similarity index 100% rename from gentree.py rename to src/gentree.py diff --git a/utils.py b/src/utils.py similarity index 100% rename from utils.py rename to src/utils.py