Answer the question
In order to leave comments, you need to log in
Is it possible to make more than 1 pytelegrambotapi webhook?
There is a tg bot. One part of it is implemented through winwinbot (the webhook responsible for the mailing), and the other needs to be written. Since the bot already has a webhook, the bot cannot receive server responses via bot.polling(), an error pops up
Conflict: can\'t use getUpdates method while webhook is active
. Answer the question
In order to leave comments, you need to log in
It is forbidden. And how do you imagine it? Will a user receive two contradictory responses to one message?
You can use a crutch: set the address of a webhook that will send messages to other addresses. PHP code example:
<?php
$webhooks = array(
'https://example.com/webhook1',
'https://example.com/webhook2',
// Здесь указываете адреса других вебхуков
);
$data = file_get_contents('php://input');
$lendata = strlen(data);
foreach ($webhooks as $url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . $lendata,
));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);
curl_close($ch);
}
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question