Skip to content

Added poll support

Choose a tag to compare

@Amele9 Amele9 released this 07 Feb 12:09
· 28 commits to master since this release
e1af0c5

Important changes

  • The default value for the raise_errors option has been changed to False
  • Now if an error is received during event handling, the bot will attempt to handle the event again after 5 seconds

Features

  • Added poll support

Example of working with a poll

You can subscribe to notifications for incoming polls and incoming poll updates using the poll_message and poll_update_message decorators. Example:

@bot.router.poll_message()
def poll_message_handler(notification: Notification) -> None:
    print(notification.event["messageData"]["pollMessageData"]["options"])
@bot.router.poll_update_message()
def poll_update_message_handler(notification: Notification) -> None:
    print(notification.event["messageData"]["pollMessageData"]["votes"])