@codebam/cf-workers-telegram-bot 7.8.0 → 7.9.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/api.d.ts CHANGED
@@ -10,6 +10,7 @@ export default class API {
10
10
  reply_to_message_id: number | string;
11
11
  chat_id: number | string;
12
12
  text: string;
13
+ parse_mode: string;
13
14
  }): Promise<Response>;
14
15
  static sendVideo(botApi: string, data: {
15
16
  reply_to_message_id: number | string;
package/dist/ctx.d.ts CHANGED
@@ -15,5 +15,5 @@ export default class TelegramExecutionContext {
15
15
  replyVideo(video: string): Promise<Response | undefined>;
16
16
  getFile(file_id: string): Promise<ArrayBuffer>;
17
17
  replyPhoto(photo: string, caption?: string): Promise<Response | undefined>;
18
- reply(message: string): Promise<Response | undefined>;
18
+ reply(message: string, parse_mode?: string): Promise<Response | undefined>;
19
19
  }
package/dist/ctx.js CHANGED
@@ -81,19 +81,21 @@ export default class TelegramExecutionContext {
81
81
  break;
82
82
  }
83
83
  }
84
- async reply(message) {
84
+ async reply(message, parse_mode = '') {
85
85
  switch (this.update_type) {
86
86
  case 'message':
87
87
  return await API.sendMessage(this.bot.api.toString(), {
88
88
  chat_id: this.update.message?.chat.id.toString() ?? '',
89
89
  reply_to_message_id: this.update.message?.message_id.toString() ?? '',
90
90
  text: message,
91
+ parse_mode,
91
92
  });
92
93
  case 'photo':
93
94
  return await API.sendMessage(this.bot.api.toString(), {
94
95
  chat_id: this.update.message?.chat.id.toString() ?? '',
95
96
  reply_to_message_id: this.update.message?.message_id.toString() ?? '',
96
97
  text: message,
98
+ parse_mode,
97
99
  });
98
100
  case 'inline':
99
101
  return await API.answerInline(this.bot.api.toString(), {
package/dist/main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import ExecutionContext from './ctx';
1
+ import TelegramExecutionContext from './ctx';
2
2
  import TelegramBot from './telegram_bot';
3
3
  import * as Types from './types';
4
- export { TelegramBot, Types, ExecutionContext };
4
+ export { TelegramBot, Types, TelegramExecutionContext };
package/dist/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import ExecutionContext from './ctx';
1
+ import TelegramExecutionContext from './ctx';
2
2
  import TelegramBot from './telegram_bot';
3
3
  import * as Types from './types';
4
- export { TelegramBot, Types, ExecutionContext };
4
+ export { TelegramBot, Types, TelegramExecutionContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebam/cf-workers-telegram-bot",
3
- "version": "7.8.0",
3
+ "version": "7.9.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",
@@ -43,5 +43,5 @@
43
43
  "typescript-eslint": "^7.8.0",
44
44
  "vitest": "^1.6.0"
45
45
  },
46
- "gitHead": "f70461a7e08ddedf437e1ee761c0c40c6184f3f2"
46
+ "gitHead": "fa69502af0756cbd15cb94fae32a2e3b7672d46d"
47
47
  }