New parameters of sendPoll method
This commit is contained in:
@@ -1025,6 +1025,7 @@ async def _load_talking_sessions(bot: Bot):
|
|||||||
|
|
||||||
|
|
||||||
async def _father_command(bot, update):
|
async def _father_command(bot, update):
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -664,18 +664,33 @@ class TelegramBot:
|
|||||||
parameters=locals()
|
parameters=locals()
|
||||||
)
|
)
|
||||||
|
|
||||||
async def sendPoll(self, chat_id, question, options,
|
async def sendPoll(self,
|
||||||
dummy=None,
|
chat_id: Union[int, str],
|
||||||
disable_notification=None,
|
question: str,
|
||||||
reply_to_message_id=None,
|
options: List[str],
|
||||||
|
is_anonymous: bool = True,
|
||||||
|
type_: str = 'regular',
|
||||||
|
allows_multiple_answers: bool = False,
|
||||||
|
correct_option_id: int = None,
|
||||||
|
explanation: str = None,
|
||||||
|
explanation_parse_mode: str = None,
|
||||||
|
open_period: int = None,
|
||||||
|
close_date: int = None,
|
||||||
|
is_closed: bool = None,
|
||||||
|
disable_notification: bool = None,
|
||||||
|
reply_to_message_id: int = None,
|
||||||
reply_markup=None):
|
reply_markup=None):
|
||||||
"""Send a native poll in a group, a supergroup or channel.
|
"""Send a native poll in a group, a supergroup or channel.
|
||||||
|
|
||||||
See https://core.telegram.org/bots/api#sendpoll for details.
|
See https://core.telegram.org/bots/api#sendpoll for details.
|
||||||
"""
|
"""
|
||||||
|
# To avoid shadowing `type`, this workaround is required
|
||||||
|
parameters = locals().copy()
|
||||||
|
parameters['type'] = parameters['type_']
|
||||||
|
del parameters['type_']
|
||||||
return await self.api_request(
|
return await self.api_request(
|
||||||
'sendPoll',
|
'sendPoll',
|
||||||
parameters=locals()
|
parameters=parameters
|
||||||
)
|
)
|
||||||
|
|
||||||
async def sendChatAction(self, chat_id, action):
|
async def sendChatAction(self, chat_id, action):
|
||||||
|
|||||||
Reference in New Issue
Block a user