You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have multiple small Telegram bots that do, mostly, useless crap.
IMHO have a BotMan studio running for each of my small bots it's an overkill.
I'll try to explain my idea to support multiple telegram bots with one single BotMan Studio installation.
I'm not a Laravel expert and what I would like to know it's if this can be done or maybe there is a better way to do it.
The main issue is the Telegram Token. If we could load dynamically that, then, probably, BotMan Studio would work without any additional trouble.
Change the routing to something like this (changing also the $except on class VerifyCsrfToken): Route::match(['get', 'post'], '/botman/{botusername?}', 'BotManController@handle');
Then on BotMan Studio .env map each token like this:
At this point when we land on the route https://yourapp.domain/botman/{botusername} we set the {botusername} 'somewhere' and then use that to load the Telegram Token dynamically inside the TelegramDriver class.
Does this make any sense or there is a simpler way to achieve the same result?
Thanks!
The text was updated successfully, but these errors were encountered:
The same way you have a different Laravel app for each website you built, you have a different Botman app for each bot you have published. It's the same as a web or api, you need to have your specific models, database, controllers, etc...
If the logic behind your multiple bots are always the same, maybe what you need is just one bot instead.
@Lloople I disagree. Why would you require a Laravel app for each website? What if you build something like a headless CMS that provides data to your multiple websites - or if you simply build multiple "sub" websites on your one Laravel app?
I'm in the same situation where multiple bots are required on the same installation. Why limit the developer?
@Kianda were you able to figure out a possible solution?
@Erik-Jonker yes, managed to get it working on Telegram (vendor/botman/driver-telegram/src/TelegramDriver.php) but the modifications I've made are not super 'clean'!
It was just a "quick fix" to get it working asap on a single install.
I made a patch (cweagans/composer-patches) instead of a fork, I should be able to get it if you want!
I have multiple small Telegram bots that do, mostly, useless crap.
IMHO have a BotMan studio running for each of my small bots it's an overkill.
I'll try to explain my idea to support multiple telegram bots with one single BotMan Studio installation.
I'm not a Laravel expert and what I would like to know it's if this can be done or maybe there is a better way to do it.
The main issue is the Telegram Token. If we could load dynamically that, then, probably, BotMan Studio would work without any additional trouble.
My idea is this:
Change the Telegram webook from:
https://yourapp.domain/botman
to
https://yourapp.domain/botman/{botusername}
Change the routing to something like this (changing also the $except on class VerifyCsrfToken):
Route::match(['get', 'post'], '/botman/{botusername?}', 'BotManController@handle');
Then on BotMan Studio .env map each token like this:
At this point when we land on the route https://yourapp.domain/botman/{botusername} we set the {botusername} 'somewhere' and then use that to load the Telegram Token dynamically inside the TelegramDriver class.
Does this make any sense or there is a simpler way to achieve the same result?
Thanks!
The text was updated successfully, but these errors were encountered: