Skip to content

Commit 070a1da

Browse files
author
J.P
committed
fix(service): 支持PDF文件上传
扩展文件类型检测逻辑,在BookBot服务中添加对.pdf文件的支持
1 parent ba99202 commit 070a1da

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/com/jp/epubbot/service/BookBot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ public void onUpdateReceived(Update update) {
8080
}
8181
Document doc = update.getMessage().getDocument();
8282
String fileName = doc.getFileName();
83-
if (fileName != null && (fileName.toLowerCase().endsWith(".epub") || fileName.toLowerCase().endsWith(".txt"))) {
83+
if (fileName != null && (fileName.toLowerCase().endsWith(".epub") || fileName.toLowerCase().endsWith(".txt") || fileName.toLowerCase().endsWith(".pdf"))) {
8484
handleBookFile(chatId, doc);
8585
} else {
86-
sendText(chatId, "请发送 .epub 格式的文件。");
86+
sendText(chatId, "请发送 .epub .txt .pdf 格式的文件。");
8787
}
8888
return;
8989
}

0 commit comments

Comments
 (0)