@codebam/cf-workers-telegram-bot 11.0.0 → 11.1.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.
@@ -128,7 +128,7 @@ export default class TelegramBot {
128
128
  this.webhook = new Webhook(this.token, request);
129
129
  const url = new URL(request.url);
130
130
  // Check if the request is for this bot
131
- if (`/${this.token}` !== url.pathname) {
131
+ if (!url.pathname.startsWith(`/${this.token}`)) {
132
132
  return new Response('Invalid token', { status: 404 });
133
133
  }
134
134
  // Handle different HTTP methods
@@ -157,7 +157,7 @@ export default class TelegramBot {
157
157
  }
158
158
  case 'GET': {
159
159
  const command = url.searchParams.get('command');
160
- if (command === 'set') {
160
+ if (command === 'set' || url.pathname.endsWith('/setWebhook')) {
161
161
  return this.webhook.set();
162
162
  }
163
163
  return new Response('Invalid command', { status: 400 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebam/cf-workers-telegram-bot",
3
- "version": "11.0.0",
3
+ "version": "11.1.0",
4
4
  "description": "serverless telegram bot on cf workers",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",