Open dimitrii9000 opened 4 months ago
@dimitrii9000 At the moment, the bot does not have an incoming call handler. Clients can add it themselves. We will take your wishes into account and add this feature in future releases
Thanks! For any other interested parties, it's quite easy to add custom handler to handle calls
from whatsapp_chatbot_python.manager.observer import Observer
class WhatsappMessageHandler:
def __init__(self, bot: GreenAPIBot):
self.bot = bot
self.bot.router.incoming_call = Observer(self.bot.router)
self.bot.router.observers["incomingCall"] = self.bot.router.incoming_call
@self.bot.router.incoming_call()
def message_handler(notification: Notification) -> None:
logging.info(notification.event)
@dimitrii9000 Good afternoon! To process incoming call notifications, you must enable the
"incomingCallWebhook": "yes"
option in the instance settings You can get acquainted with the type of webhook notifications about calls here