Skip to content

Commit

Permalink
fix: fix non-image file error uploaded to telegraph
Browse files Browse the repository at this point in the history
  • Loading branch information
adolphnov committed Aug 10, 2024
1 parent 0e0ae66 commit 1f3e8c1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sha":"15a9828","timestamp":1723313350}
{"sha":"0e0ae66","timestamp":1723313922}
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ var Environment = class {
// -- 版本数据 --
//
// 当前版本
BUILD_TIMESTAMP = 1723313350;
BUILD_TIMESTAMP = 1723313922;
// 当前版本 commit id
BUILD_VERSION = "15a9828";
BUILD_VERSION = "0e0ae66";
// -- 基础配置 --
/**
* @type {I18n | null}
Expand Down Expand Up @@ -2432,7 +2432,7 @@ async function extractMessageType(message, botToken) {
if (!file_url) {
throw new Error("file url get failed.");
}
if (ENV.TELEGRAPH_ENABLE) {
if (ENV.TELEGRAPH_ENABLE && fileType === "photo") {
file_url = await uploadImageToTelegraph(file_url);
}
info.file_url = file_url;
Expand Down
2 changes: 1 addition & 1 deletion dist/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1723313350
1723313922
2 changes: 1 addition & 1 deletion src/config/middle.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function extractMessageType(message, botToken) {
throw new Error('file url get failed.');
}

if (ENV.TELEGRAPH_ENABLE) {
if (ENV.TELEGRAPH_ENABLE && fileType === 'photo') {
file_url = await uploadImageToTelegraph(file_url);
}

Expand Down

0 comments on commit 1f3e8c1

Please sign in to comment.