Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions module/offline_download/offline_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "/":
Expand All @@ -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:
Expand Down
12 changes: 6 additions & 6 deletions module/search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down Expand Up @@ -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)

Expand All @@ -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:
Expand All @@ -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):
Expand Down Expand Up @@ -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

Expand Down
14 changes: 8 additions & 6 deletions module/storage_browse/storage_browse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand Down Expand Up @@ -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"
)


Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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}")

Expand Down Expand Up @@ -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"
)


Expand Down
14 changes: 7 additions & 7 deletions module/tmdb_search/tmdb_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions module/torrent_search/torrent_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down