0

I am using Telegram Bot Php-Sdk. As the question is self explanatory, I am trying to run multiple bots on same domain but different routes. I have a live bot with webhook setup at mybot.domain.com/someroute and a staging bot at mybot2.domain.com/someroute. Both are at different servers. Today I created a new bot, created a new Controller and passed bot token inside this Controller's Constructor e.g.

class BotController extends Controller{
function __construct() {
   config(['telegram.bot_token'=>'my_bot_token');
}
}

I have a new webhook for this new bot as mybot2.domain.com/DifferentRoute. But since the time of deployment and webhook setup for this new bot, my all 3 bots are not responding. I am not getting any chat data on getWebhookUpdate function. Need guidance Thanks

Talha Malik
  • 1,509
  • 3
  • 22
  • 44

1 Answers1

2

You can use query string to distinguish between bots.

For instance, bot A use https://example.com/hook?bot=MyBot, and you can identify them in code.

Sean Wei
  • 7,433
  • 1
  • 19
  • 39