From 993853757b1f9f7f8619a815449e527c6d7938ee Mon Sep 17 00:00:00 2001 From: 6vision Date: Mon, 15 Jul 2024 18:57:58 +0800 Subject: [PATCH] Linkai bot supports more file types. --- bot/linkai/link_ai_bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/linkai/link_ai_bot.py b/bot/linkai/link_ai_bot.py index 3fe8131..95c514d 100644 --- a/bot/linkai/link_ai_bot.py +++ b/bot/linkai/link_ai_bot.py @@ -399,6 +399,7 @@ class LinkAIBot(Bot): return max_send_num = conf().get("max_media_send_count") send_interval = conf().get("media_send_interval") + file_type = (".pdf", ".doc", ".docx", ".csv", ".xls", ".xlsx", ".txt", ".rtf", ".ppt", ".pptx") try: i = 0 for url in image_urls: @@ -407,7 +408,7 @@ class LinkAIBot(Bot): i += 1 if url.endswith(".mp4"): reply_type = ReplyType.VIDEO_URL - elif url.endswith(".pdf") or url.endswith(".doc") or url.endswith(".docx") or url.endswith(".csv"): + elif url.endswith(file_type): reply_type = ReplyType.FILE url = _download_file(url) if not url: