@codebam/cf-workers-telegram-bot 12.3.0 → 12.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.
@@ -40,6 +40,11 @@ export default class TelegramExecutionContext {
40
40
  * @returns The user ID or undefined if not available
41
41
  */
42
42
  get userId(): number | undefined;
43
+ /**
44
+ * Check if the message sender is a bot
45
+ * @returns True if the sender is a bot
46
+ */
47
+ get isBot(): boolean;
43
48
  /**
44
49
  * Parse arguments from the update
45
50
  * @returns array of argument strings
@@ -49,6 +49,16 @@ export default class TelegramExecutionContext {
49
49
  get userId() {
50
50
  return this.update.message?.from?.id ?? this.update.business_message?.from?.id ?? this.update.guest_message?.from?.id;
51
51
  }
52
+ /**
53
+ * Check if the message sender is a bot
54
+ * @returns True if the sender is a bot
55
+ */
56
+ get isBot() {
57
+ return (this.update.message?.from?.is_bot ??
58
+ this.update.business_message?.from?.is_bot ??
59
+ this.update.guest_message?.from?.is_bot ??
60
+ false);
61
+ }
52
62
  /**
53
63
  * Parse arguments from the update
54
64
  * @returns array of argument strings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebam/cf-workers-telegram-bot",
3
- "version": "12.3.0",
3
+ "version": "12.4.0",
4
4
  "description": "serverless telegram bot on cf workers",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",