@codebam/cf-workers-telegram-bot 12.6.0 → 12.6.2

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.
@@ -129,6 +129,9 @@ export default class TelegramBot {
129
129
  // Then check if there's a command starting with / anywhere in the message
130
130
  const commandIndex = args.findIndex((arg) => arg.startsWith('/'));
131
131
  if (commandIndex !== -1) {
132
+ if (ctx.update_type === 'message' && ctx.update.message?.chat.type !== 'private') {
133
+ return this.defaultCommand;
134
+ }
132
135
  const fullCommand = args[commandIndex];
133
136
  const command = fullCommand.substring(1, fullCommand.lastIndexOf('@') > -1 ? fullCommand.lastIndexOf('@') : fullCommand.length);
134
137
  if (command in this.commands) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebam/cf-workers-telegram-bot",
3
- "version": "12.6.0",
3
+ "version": "12.6.2",
4
4
  "description": "serverless telegram bot on cf workers",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",
@@ -61,4 +61,4 @@
61
61
  "./src/main.ts"
62
62
  ]
63
63
  }
64
- }
64
+ }