1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Merge pull request #659 from OslikAi/master

Add Poll
This commit is contained in:
FrankWang
2019-06-28 21:02:23 +08:00
committed by GitHub
4 changed files with 88 additions and 0 deletions

View File

@@ -113,6 +113,7 @@ class TeleBot:
getUserProfilePhotos
getUpdates
getFile
sendPoll
kickChatMember
unbanChatMember
restrictChatMember
@@ -1044,6 +1045,12 @@ class TeleBot:
disable_notification, reply_to_message_id, reply_markup, provider_data)
return types.Message.de_json(result)
def send_poll(self, chat_id, poll, disable_notifications=False, reply_to_message=None, reply_markup=None):
return types.Message.de_json(apihelper.send_poll(self.token, chat_id, poll.question, poll.options, disable_notifications, reply_to_message, reply_markup))
def stop_poll(self, chat_id, message_id):
return types.Poll.de_json(apihelper.stop_poll(self.token, chat_id, message_id))
def answer_shipping_query(self, shipping_query_id, ok, shipping_options=None, error_message=None):
return apihelper.answer_shipping_query(self.token, shipping_query_id, ok, shipping_options, error_message)
@@ -1750,3 +1757,11 @@ class AsyncTeleBot(TeleBot):
@util.async_dec()
def delete_sticker_from_set(self, *args, **kwargs):
return TeleBot.delete_sticker_from_set(self, *args, **kwargs)
@util.async_dec()
def send_poll(self, *args, **kwargs):
return TeleBot.send_poll(self, *args, **kwargs)
@util.async_dec()
def stop_poll(self, *args, **kwargs):
return TeleBot.stop_poll(self, *args, **kwargs)