@codebam/cf-workers-telegram-bot 4.1.0 → 4.3.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.
@@ -1,5 +1,5 @@
1
1
  import { sha256, log } from "./libs";
2
- import { Config, localhost, } from "./types";
2
+ import { Config, localhost } from "./types";
3
3
  export default class Handler {
4
4
  configs;
5
5
  constructor(configs) {
@@ -42,8 +42,9 @@ export default class TelegramApi extends BotApi {
42
42
  .split(" "))
43
43
  : this.updates.default;
44
44
  // execute the inline custom bot commands from bot configurations
45
- executeInlineCommand = async (update) => this._executeCommand(update, update.inline_query?.query ?? "").then(async (command_response) => command_response &&
46
- this._executeCommand(update, "inline", update.inline_query?.query.trimStart().split(" ")).then((_command_response) => _command_response)) ?? this.updates.default;
45
+ executeInlineCommand = async (update) => this._executeCommand(update, update.inline_query?.query ?? "").then(async (command_response) => command_response
46
+ ? this._executeCommand(update, "inline", update.inline_query?.query.trimStart().split(" ")).then((_command_response) => _command_response)
47
+ : this.updates.default);
47
48
  // execute the custom bot commands from bot configurations
48
49
  executeCommand = async (update) => this._executeCommand(update, update.message?.text ?? "") ??
49
50
  this.updates.default;
@@ -7,6 +7,6 @@ interface Environment {
7
7
  SECRET_TELEGRAM_API_TOKEN3: string;
8
8
  }
9
9
  declare const _default: {
10
- fetch: (request: Request, env: Environment) => Promise<any>;
10
+ fetch: (request: Request, env: Environment) => Promise<Response>;
11
11
  };
12
12
  export default _default;
@@ -1,4 +1,4 @@
1
- import { TelegramCommands, Handler, TelegramWebhook, TelegramBot, Libs, } from "../../main/src/main";
1
+ import { TelegramCommands, Handler, TelegramWebhook, TelegramBot, } from "../../main/src/main";
2
2
  export default {
3
3
  fetch: async (request, env) => new Handler([
4
4
  {
@@ -49,7 +49,5 @@ export default {
49
49
  "/start": TelegramCommands.commandList,
50
50
  },
51
51
  },
52
- ])
53
- .handle(request)
54
- .then(Libs.log),
52
+ ]).handle(request),
55
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebam/cf-workers-telegram-bot",
3
- "version": "4.1.0",
3
+ "version": "4.3.0",
4
4
  "description": "serverless telegram bot on cf workers",
5
5
  "main": "./dist/main/src/main.js",
6
6
  "module": "./dist/main/src/main.js",
@@ -29,17 +29,17 @@
29
29
  "url": "https://github.com/codebam/cf-workers-telegram-bot.git"
30
30
  },
31
31
  "dependencies": {
32
- "worker": "^4.1.0"
32
+ "worker": "^4.3.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@cloudflare/workers-types": "^4.20230221.0",
36
- "@typescript-eslint/eslint-plugin": "^5.53.0",
37
- "@typescript-eslint/parser": "^5.53.0",
36
+ "@typescript-eslint/eslint-plugin": "^5.54.0",
37
+ "@typescript-eslint/parser": "^5.54.0",
38
38
  "eslint": "^8.35.0",
39
39
  "eslint-config-prettier": "^8.6.0",
40
40
  "lerna": "^6.5.1",
41
41
  "prettier": "^2.8.4",
42
42
  "typescript": "^4.9.5"
43
43
  },
44
- "gitHead": "06ba99e3db30c7f49b936ad9b4b02b7a4c17bec2"
44
+ "gitHead": "50f18f12801dd88245757cb2ecca932cae3066ae"
45
45
  }