@codebam/cf-workers-telegram-bot 4.2.0 → 4.4.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.
@@ -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;
@@ -1,4 +1,4 @@
1
- export default class TelegramCommands {
1
+ class TelegramCommands {
2
2
  static ping = async (bot, update, args) => bot.ping(update, args);
3
3
  static toss = async (bot, update) => bot.toss(update);
4
4
  static epoch = async (bot, update) => bot.epoch(update);
@@ -14,3 +14,4 @@ export default class TelegramCommands {
14
14
  static code = async (bot, update) => bot.code(update);
15
15
  static commandList = async (bot, update) => bot.commandList(update);
16
16
  }
17
+ export default TelegramCommands;
@@ -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.2.0",
3
+ "version": "4.4.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": "^0.4.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@cloudflare/workers-types": "^4.20230221.0",
36
- "@typescript-eslint/eslint-plugin": "^5.53.0",
37
- "@typescript-eslint/parser": "^5.53.0",
38
- "eslint": "^8.35.0",
39
- "eslint-config-prettier": "^8.6.0",
35
+ "@cloudflare/workers-types": "^4.20230307.0",
36
+ "@typescript-eslint/eslint-plugin": "^5.55.0",
37
+ "@typescript-eslint/parser": "^5.55.0",
38
+ "eslint": "^8.36.0",
39
+ "eslint-config-prettier": "^8.7.0",
40
40
  "lerna": "^6.5.1",
41
41
  "prettier": "^2.8.4",
42
- "typescript": "^4.9.5"
42
+ "typescript": "^5.0.2"
43
43
  },
44
- "gitHead": "64e651e0a6b2358ea609ea5bcdc8baf326cb9c87"
44
+ "gitHead": "91f69e27817de9f1f06e8c0ebc9ffea7de642faa"
45
45
  }