diff --git a/module/offline_download/offline_download.py b/module/offline_download/offline_download.py index 9e6f15f..1fd4ab1 100644 --- a/module/offline_download/offline_download.py +++ b/module/offline_download/offline_download.py @@ -271,7 +271,7 @@ async def show_path_browser(query, cache, path): buttons.append([InlineKeyboardButton(f"📄 {name}", callback_data=f"od_file_{name}")]) # 添加确认按钮 - buttons.append([InlineKeyboardButton("✅ 确认路径", callback_data="od_confirm_path")]) + buttons.append([InlineKeyboardButton("✅ 确认此路径", callback_data="od_confirm_path")]) # 添加返回按钮 if path != "/": @@ -282,8 +282,9 @@ async def show_path_browser(query, cache, path): cache["path"] = path await query.message.edit_text( - f"📁 选择存储路径: `{path}`\n\n点击目录进入,点击确认路径按钮完成选择", - reply_markup=InlineKeyboardMarkup(buttons) + f"📁 选择存储路径: `{path}`\n\n点击目录进入,点击确认此路径按钮完成选择", + reply_markup=InlineKeyboardMarkup(buttons), + parse_mode="Markdown" ) except Exception as e: diff --git a/module/search/search.py b/module/search/search.py index f5453ab..2502f13 100644 --- a/module/search/search.py +++ b/module/search/search.py @@ -92,7 +92,7 @@ def get_text_with_info(self) -> str: filter_name = "" if self.filter_type: filter_name = f" | {PAN_TYPE_EMOJI.get(self.filter_type, self.filter_type)}" - filter_info = f"🔍 关键词: {self.keyword} | 结果: {total} 条{filter_name}\n\n" + filter_info = f"🔍 {self.keyword} | {total} 条结果{filter_name}\n\n" return filter_info + text def now_page(self) -> tuple[str, int, int]: @@ -155,9 +155,9 @@ def btn(self) -> list: buttons.append(row) nav_buttons = [ - InlineKeyboardButton("⬆️上一页", callback_data="search_previous_page"), + InlineKeyboardButton("⬆️ 上一页", callback_data="search_previous_page"), InlineKeyboardButton(f"{self.index + 1}/{self.page_count}", callback_data="search_pages"), - InlineKeyboardButton("⬇️下一页", callback_data="search_next_page"), + InlineKeyboardButton("⬇️ 下一页", callback_data="search_next_page"), ] buttons.append(nav_buttons) @@ -175,7 +175,7 @@ async def s_command(update: Update, context: ContextTypes.DEFAULT_TYPE): k = " ".join(context.args) if not k: - return await update.message.reply_text("请加上文件名,例:`/s 巧克力`") + return await update.message.reply_text("请加上文件名,例:`/s 巧克力`", parse_mode="Markdown") msg = await update.message.reply_text("搜索中...") try: @@ -187,7 +187,7 @@ async def s_command(update: Update, context: ContextTypes.DEFAULT_TYPE): return await msg.edit_text("未搜索到文件,换个关键词试试吧") text, button = await build_result(results, msg, k) - await msg.edit_text(text=text, reply_markup=InlineKeyboardMarkup(button), disable_web_page_preview=True) + await msg.edit_text(text=text, reply_markup=InlineKeyboardMarkup(button), parse_mode="Markdown", disable_web_page_preview=True) async def build_result(content: list[PanSouResult], msg, keyword: str): @@ -282,7 +282,7 @@ async def search_callback(update: Update, context: ContextTypes.DEFAULT_TYPE): return try: - await msg.edit_text(text, reply_markup=InlineKeyboardMarkup(page.btn), disable_web_page_preview=True) + await msg.edit_text(text, reply_markup=InlineKeyboardMarkup(page.btn), parse_mode="Markdown", disable_web_page_preview=True) except Exception: pass diff --git a/module/storage_browse/storage_browse.py b/module/storage_browse/storage_browse.py index 06f7b57..28b5c4d 100644 --- a/module/storage_browse/storage_browse.py +++ b/module/storage_browse/storage_browse.py @@ -91,7 +91,7 @@ async def st_command(update: Update, context: ContextTypes.DEFAULT_TYPE, message buttons = [] for storage in storages: name = storage.remark or storage.mount_path or str(storage.id) - status = "❎" if storage.disabled else "✅" + status = "❌" if storage.disabled else "✅" mount_path = storage.mount_path or "/" btn = InlineKeyboardButton( f"{status}{name}", @@ -146,7 +146,8 @@ async def storage_callback(update: Update, context: ContextTypes.DEFAULT_TYPE): await query.message.edit_text( text=text, - reply_markup=InlineKeyboardMarkup(buttons) + reply_markup=InlineKeyboardMarkup(buttons), + parse_mode="Markdown" ) @@ -188,7 +189,7 @@ async def file_callback(update: Update, context: ContextTypes.DEFAULT_TYPE): content = FILE_CACHE.get(f"{chat_id}_files", []) asyncio.create_task(send_typing(context, chat_id)) text, buttons = await build_file_list(content, current_path, msg_id, chat_id, page=page) - await query.message.edit_text(text=text, reply_markup=InlineKeyboardMarkup(buttons)) + await query.message.edit_text(text=text, reply_markup=InlineKeyboardMarkup(buttons), parse_mode="Markdown") return if data == "back": @@ -238,7 +239,7 @@ async def copy_file_link(query, file_path: str): else: text = f"文件: `{file_name}`\n\n打开链接: {full_url}" - await query.message.reply_text(text, disable_web_page_preview=True) + await query.message.reply_text(text, parse_mode="Markdown", disable_web_page_preview=True) except Exception as e: await query.message.reply_text(f"获取链接失败: {e}") @@ -277,14 +278,15 @@ async def navigate_to_path(query, chat_id: int, msg_id: int, path: str, context: InlineKeyboardButton("📁+ 新建文件夹", callback_data="st_mkdir"), InlineKeyboardButton("📤 上传文件", callback_data="st_upload"), ]) - await query.message.edit_text(text=text, reply_markup=InlineKeyboardMarkup(btns)) + await query.message.edit_text(text=text, reply_markup=InlineKeyboardMarkup(btns), parse_mode="Markdown") return text, buttons = await build_file_list(content, path, msg_id, chat_id) await query.message.edit_text( text=text, - reply_markup=InlineKeyboardMarkup(buttons) + reply_markup=InlineKeyboardMarkup(buttons), + parse_mode="Markdown" ) diff --git a/module/tmdb_search/tmdb_search.py b/module/tmdb_search/tmdb_search.py index f927ea7..e8d6ab2 100644 --- a/module/tmdb_search/tmdb_search.py +++ b/module/tmdb_search/tmdb_search.py @@ -52,14 +52,14 @@ def now_page_text(self) -> tuple[str, list]: text_parts.append(text) buttons.extend(item_btns) - header = f"🎬 搜索: {self.keyword} | 找到: {len(self.all_results)} 条\n\n" + header = f"🔍 {self.keyword} | {len(self.all_results)} 条结果\n\n" text = header + "".join(text_parts) - + if self.page_count > 1: nav_buttons = [ - InlineKeyboardButton("⬆️", callback_data="tmdb_previous"), + InlineKeyboardButton("⬆️ 上一页", callback_data="tmdb_previous"), InlineKeyboardButton(f"{self.index + 1}/{self.page_count}", callback_data="tmdb_page"), - InlineKeyboardButton("⬇️", callback_data="tmdb_next"), + InlineKeyboardButton("⬇️ 下一页", callback_data="tmdb_next"), ] buttons.append(nav_buttons) @@ -100,13 +100,13 @@ async def sm_command(update: Update, context: ContextTypes.DEFAULT_TYPE): args = context.args if not args: - return await update.message.reply_text("请加上关键词,例:`/sm 电影名称`") + return await update.message.reply_text("请加上关键词,例:`/sm 电影名称`", parse_mode="Markdown") keyword = " ".join(args) if not keyword: - return await update.message.reply_text("请加上关键词,例:`/sm 电影名称`") + return await update.message.reply_text("请加上关键词,例:`/sm 电影名称`", parse_mode="Markdown") - search_msg = await update.message.reply_text("🔎 搜索中...") + search_msg = await update.message.reply_text("🔄 搜索中...") try: tmdb = get_tmdb(bot_cfg.tmdb_api_key) diff --git a/module/torrent_search/torrent_search.py b/module/torrent_search/torrent_search.py index 7889886..ec59e74 100644 --- a/module/torrent_search/torrent_search.py +++ b/module/torrent_search/torrent_search.py @@ -96,13 +96,13 @@ def now_page_text(self) -> tuple[str, list]: text_parts.append(text) buttons.extend(item_btns) - header = f"🔍 关键词: {self.keyword} | 结果: {len(self.all_results)} 条\n\n" + header = f"🔍 {self.keyword} | {len(self.all_results)} 条结果\n\n" text = header + "".join(text_parts) - + nav_buttons = [ - InlineKeyboardButton("⬆️", callback_data="torrent_previous"), + InlineKeyboardButton("⬆️ 上一页", callback_data="torrent_previous"), InlineKeyboardButton(f"{self.index + 1}/{self.page_count}", callback_data="torrent_page"), - InlineKeyboardButton("⬇️", callback_data="torrent_next"), + InlineKeyboardButton("⬇️ 下一页", callback_data="torrent_next"), ] buttons.append(nav_buttons)