@codebam/cf-workers-telegram-bot 7.19.0 → 7.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/telegram_api.js +8 -1
- package/package.json +3 -5
package/dist/telegram_api.js
CHANGED
|
@@ -11,7 +11,14 @@ export default class TelegramApi {
|
|
|
11
11
|
const url = this.getApiUrl(botApi, 'getFile', data);
|
|
12
12
|
const response = await fetch(url);
|
|
13
13
|
const json = await response.json();
|
|
14
|
-
|
|
14
|
+
let file_path;
|
|
15
|
+
try {
|
|
16
|
+
file_path = json.result.file_path;
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
console.log(`Error: ${e}`);
|
|
20
|
+
return new Response('cant read file_path. is the file too large?');
|
|
21
|
+
}
|
|
15
22
|
return await fetch(`https://api.telegram.org/file/bot${token}/${file_path}`);
|
|
16
23
|
}
|
|
17
24
|
async sendMessage(botApi, data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codebam/cf-workers-telegram-bot",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.22.0",
|
|
4
4
|
"description": "serverless telegram bot on cf workers",
|
|
5
5
|
"main": "./dist/main.js",
|
|
6
6
|
"module": "./dist/main.js",
|
|
@@ -35,14 +35,12 @@
|
|
|
35
35
|
"@eslint/js": "^9.3.0",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
|
37
37
|
"@typescript-eslint/parser": "^7.10.0",
|
|
38
|
-
"eslint": "^
|
|
38
|
+
"eslint": "^9.3.0",
|
|
39
39
|
"eslint-config-prettier": "^9.1.0",
|
|
40
40
|
"globals": "^15.3.0",
|
|
41
|
-
"lerna": "^8.1.2",
|
|
42
41
|
"prettier": "^3.2.5",
|
|
43
42
|
"typescript": "^5.4.5",
|
|
44
43
|
"typescript-eslint": "^7.10.0",
|
|
45
44
|
"vitest": "^1.6.0"
|
|
46
|
-
}
|
|
47
|
-
"gitHead": "6a464429f3ce661593659db8145d5b73ac75e5e3"
|
|
45
|
+
}
|
|
48
46
|
}
|