Skip to content
This repository has been archived by the owner on Jun 2, 2019. It is now read-only.

Add new content type "poll" #457

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .telepot import *
6 changes: 3 additions & 3 deletions telepot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from . import exception


__version_info__ = (12, 7)
__version_info__ = (12, 8)
__version__ = '.'.join(map(str, __version_info__))


Expand Down Expand Up @@ -65,15 +65,15 @@ def _find_first_key(d, keys):
for k in keys:
if k in d:
return k
raise KeyError('No suggested keys %s in %s' % (str(keys), str(d)))
# raise KeyError('No suggested keys %s in %s' % (str(keys), str(d)))


all_content_types = [
'text', 'audio', 'document', 'game', 'photo', 'sticker', 'video', 'voice', 'video_note',
'contact', 'location', 'venue', 'new_chat_member', 'left_chat_member', 'new_chat_title',
'new_chat_photo', 'delete_chat_photo', 'group_chat_created', 'supergroup_chat_created',
'channel_chat_created', 'migrate_to_chat_id', 'migrate_from_chat_id', 'pinned_message',
'new_chat_members', 'invoice', 'successful_payment'
'new_chat_members', 'invoice', 'successful_payment', 'poll', 'my_chat_member'
]

def glance(msg, flavor='chat', long=False):
Expand Down
6 changes: 5 additions & 1 deletion telepot/loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def _extract_message(update):
'inline_query',
'chosen_inline_result',
'shipping_query',
'pre_checkout_query'])
'pre_checkout_query',
'poll',
'my_chat_member'])
if not key:
return key, update
return key, update[key]

def _infer_handler_function(bot, h):
Expand Down