Skip to content

Commit 6995241

Browse files
feat: Added the parameter members_only and country_codes to the method send_poll
1 parent 4ebd7ea commit 6995241

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

pyrogram/methods/messages/send_poll.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ async def send_poll(
3939
type: "enums.PollType" = enums.PollType.REGULAR,
4040
allows_multiple_answers: Optional[bool] = None,
4141
allows_revoting: Optional[bool] = None,
42+
members_only: Optional[bool] = None,
43+
country_codes: Optional[List[str]] = None,
4244
shuffle_options: Optional[bool] = None,
4345
allow_adding_options: Optional[bool] = None,
4446
hide_results_until_closes: Optional[bool] = None,
@@ -116,6 +118,15 @@ async def send_poll(
116118
Pass True, if the poll allows to change chosen answer options.
117119
Defaults to False for quizzes and to True for regular polls.
118120
121+
members_only (``bool``, *optional*):
122+
True, if only the users that are members of the chat for more than a day will be able to vote.
123+
For channel chats only.
124+
125+
country_codes (List of ``str``, *optional*):
126+
The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be able to vote.
127+
For channel chats only.
128+
If None, then all users can participate in the poll.
129+
119130
shuffle_options (``bool``, *optional*):
120131
Pass True, if the poll options must be shown in random order.
121132
@@ -269,6 +280,8 @@ async def send_poll(
269280
quiz=type == enums.PollType.QUIZ or False,
270281
open_answers=False if type == enums.PollType.QUIZ and allow_adding_options else allow_adding_options,
271282
revoting_disabled=not allows_revoting if allows_revoting is not None else (type == enums.PollType.QUIZ),
283+
subscribers_only=members_only,
284+
countries_iso2=country_codes,
272285
shuffle_answers=shuffle_options,
273286
hide_results_until_close=hide_results_until_closes,
274287
close_period=open_period,

0 commit comments

Comments
 (0)