Different handlers for different bots? #89
Replies: 2 comments 11 replies
-
Hi! @intoeetive ! thanks for your kind words, we are glad you find Telegraph useful Dedicated webhook handlers are not currently supported, but you could achieve something similar by defining a main webhook handler like this one: class MainWebhookHandler extends WebhookHandler
{
public function handle(Request $request, TelegraphBot $bot): void
{
match($bot->name){
'user_bot' => app(MyWebhookHandler::class)->handle($request, $bot),
'admin_bot' => app(MyAdminWebhookHandler::class)->handle($request, $bot),
default => throw new Exception('unsupported bot');
}
}
} |
Beta Was this translation helpful? Give feedback.
-
we currently support only inline keyboards, but I am working on |
Beta Was this translation helpful? Give feedback.
-
Hi @fabio-ivona
First of all - this is an excellent piece of software! I am writing telegram bot for a volunteer project, and it's really speeding up the development!
Is it possible use different Webhook Handlers for different bots? So that in config file instead of
'webhook_handler' => MyWebhookHandler::class,
I could have something like:
I think this might be a lot more convenient then figuring out where the request came from in handler itself
Also been wondering if you have plans to support
request_contact
button anytime soon? (if not, I might submit a PR for that in next few days)Beta Was this translation helpful? Give feedback.
All reactions