@codebam/cf-workers-telegram-bot 7.4.0 → 7.6.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.
|
@@ -8,7 +8,7 @@ export default class TelegramBot {
|
|
|
8
8
|
update_type: string;
|
|
9
9
|
constructor(token: string);
|
|
10
10
|
on(event: string, callback: () => Promise<Response>): this;
|
|
11
|
-
handle(request: Request): Promise<
|
|
11
|
+
handle(request: Request): Promise<Response>;
|
|
12
12
|
reply(message: string): Promise<void>;
|
|
13
13
|
}
|
|
14
14
|
declare class Webhook {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
interface Environment {
|
|
2
|
+
export interface Environment {
|
|
3
3
|
SECRET_TELEGRAM_API_TOKEN: string;
|
|
4
4
|
KV_GET_SET: KVNamespace;
|
|
5
5
|
KV_UID_DATA: KVNamespace;
|
|
@@ -13,6 +13,6 @@ interface Environment {
|
|
|
13
13
|
CHAT_MODEL: string;
|
|
14
14
|
}
|
|
15
15
|
declare const _default: {
|
|
16
|
-
fetch: (request: Request, env: Environment) => Promise<Response>;
|
|
16
|
+
fetch: (request: Request, env: Environment, ctx: ExecutionContext) => Promise<Response>;
|
|
17
17
|
};
|
|
18
18
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import TelegramBot from '../../main/src/telegram_bot';
|
|
2
2
|
export default {
|
|
3
|
-
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
|
+
fetch: async (request, env, ctx) => {
|
|
4
5
|
const bot = new TelegramBot(env.SECRET_TELEGRAM_API_TOKEN);
|
|
5
6
|
await bot
|
|
6
7
|
.on('default', async function () {
|
package/package.json
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
2
|
+
"name": "@codebam/cf-workers-telegram-bot",
|
|
3
|
+
"version": "7.6.0",
|
|
4
|
+
"description": "serverless telegram bot on cf workers",
|
|
5
|
+
"main": "./dist/main/src/main.js",
|
|
6
|
+
"module": "./dist/main/src/main.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"LICENSE",
|
|
10
|
+
"LICENSE_MIT",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"cloudflare",
|
|
15
|
+
"telegram",
|
|
16
|
+
"worker",
|
|
17
|
+
"webhook"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"private": false,
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc --project tsconfig.json",
|
|
23
|
+
"lint": "eslint src",
|
|
24
|
+
"test": "vitest --config vitest.config.js"
|
|
25
|
+
},
|
|
26
|
+
"author": "codebam",
|
|
27
|
+
"license": "Apache-2.0",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/codebam/cf-workers-telegram-bot.git"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@cloudflare/workers-types": "^4.20240502.0",
|
|
34
|
+
"@eslint/js": "^9.2.0",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
|
36
|
+
"@typescript-eslint/parser": "^7.8.0",
|
|
37
|
+
"eslint": "^9.2.0",
|
|
38
|
+
"eslint-config-prettier": "^9.1.0",
|
|
39
|
+
"globals": "^15.2.0",
|
|
40
|
+
"lerna": "^8.1.2",
|
|
41
|
+
"prettier": "^3.2.5",
|
|
42
|
+
"typescript": "^5.4.5",
|
|
43
|
+
"typescript-eslint": "^7.8.0",
|
|
44
|
+
"vitest": "^1.6.0"
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "d2c50965ef1d04fb62c9683f4418a7f4931ded93"
|
|
45
47
|
}
|