Skip to content

Commit

Permalink
add sequence to more places and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clot27 committed Dec 24, 2022
1 parent 7cfd62b commit 93fac62
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions telegram/_payment/shippingquery.py
Expand Up @@ -18,7 +18,7 @@
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""This module contains an object that represents a Telegram ShippingQuery."""

from typing import TYPE_CHECKING, List, Optional
from typing import TYPE_CHECKING, Optional, Sequence

from telegram._payment.shippingaddress import ShippingAddress
from telegram._payment.shippingoption import ShippingOption
Expand Down Expand Up @@ -92,7 +92,7 @@ def de_json(cls, data: Optional[JSONDict], bot: "Bot") -> Optional["ShippingQuer
async def answer( # pylint: disable=invalid-name
self,
ok: bool,
shipping_options: List[ShippingOption] = None,
shipping_options: Sequence[ShippingOption] = None,
error_message: str = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down
48 changes: 24 additions & 24 deletions telegram/ext/_extbot.py
Expand Up @@ -476,7 +476,7 @@ async def _send_message(
message_thread_id: int = None,
caption: str = None,
parse_mode: ODVInput[str] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
disable_web_page_preview: ODVInput[bool] = DEFAULT_NONE,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -515,7 +515,7 @@ async def get_updates(
offset: int = None,
limit: int = None,
timeout: float = None,
allowed_updates: List[str] = None,
allowed_updates: Sequence[str] = None,
*,
read_timeout: float = 2,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -646,7 +646,7 @@ async def copy_message(
message_id: int,
caption: str = None,
parse_mode: ODVInput[str] = DEFAULT_NONE,
caption_entities: Union[Tuple["MessageEntity", ...], List["MessageEntity"]] = None,
caption_entities: Sequence["MessageEntity"] = None,
disable_notification: DVInput[bool] = DEFAULT_NONE,
reply_to_message_id: int = None,
allow_sending_without_reply: DVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -828,7 +828,7 @@ async def answer_shipping_query(
self,
shipping_query_id: str,
ok: bool,
shipping_options: List[ShippingOption] = None,
shipping_options: Sequence[ShippingOption] = None,
error_message: str = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -977,9 +977,9 @@ async def create_invoice_link(
payload: str,
provider_token: str,
currency: str,
prices: List["LabeledPrice"],
prices: Sequence["LabeledPrice"],
max_tip_amount: int = None,
suggested_tip_amounts: List[int] = None,
suggested_tip_amounts: Sequence[int] = None,
provider_data: Union[str, object] = None,
photo_url: str = None,
photo_size: int = None,
Expand Down Expand Up @@ -1296,7 +1296,7 @@ async def edit_message_caption(
caption: str = None,
reply_markup: InlineKeyboardMarkup = None,
parse_mode: ODVInput[str] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -1421,7 +1421,7 @@ async def edit_message_text(
parse_mode: ODVInput[str] = DEFAULT_NONE,
disable_web_page_preview: ODVInput[bool] = DEFAULT_NONE,
reply_markup: InlineKeyboardMarkup = None,
entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
entities: Sequence["MessageEntity"] = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -1726,7 +1726,7 @@ async def get_sticker_set(

async def get_custom_emoji_stickers(
self,
custom_emoji_ids: List[str],
custom_emoji_ids: Sequence[str],
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -2044,7 +2044,7 @@ async def send_animation(
reply_to_message_id: int = None,
reply_markup: ReplyMarkup = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: int = None,
*,
Expand Down Expand Up @@ -2094,7 +2094,7 @@ async def send_audio(
parse_mode: ODVInput[str] = DEFAULT_NONE,
thumb: FileInput = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: int = None,
*,
Expand Down Expand Up @@ -2240,7 +2240,7 @@ async def send_document(
thumb: FileInput = None,
disable_content_type_detection: bool = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: int = None,
*,
Expand Down Expand Up @@ -2316,7 +2316,7 @@ async def send_invoice(
payload: str,
provider_token: str,
currency: str,
prices: List["LabeledPrice"],
prices: Sequence["LabeledPrice"],
start_parameter: str = None,
photo_url: str = None,
photo_size: int = None,
Expand All @@ -2335,7 +2335,7 @@ async def send_invoice(
send_email_to_provider: bool = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
max_tip_amount: int = None,
suggested_tip_amounts: List[int] = None,
suggested_tip_amounts: Sequence[int] = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: int = None,
*,
Expand Down Expand Up @@ -2448,7 +2448,7 @@ async def send_media_group(
rate_limit_args: RLARGS = None,
caption: Optional[str] = None,
parse_mode: ODVInput[str] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
) -> Tuple[Message, ...]:
return await super().send_media_group(
chat_id=chat_id,
Expand All @@ -2473,7 +2473,7 @@ async def send_message(
chat_id: Union[int, str],
text: str,
parse_mode: ODVInput[str] = DEFAULT_NONE,
entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
entities: Sequence["MessageEntity"] = None,
disable_web_page_preview: ODVInput[bool] = DEFAULT_NONE,
disable_notification: DVInput[bool] = DEFAULT_NONE,
protect_content: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -2518,7 +2518,7 @@ async def send_photo(
reply_markup: ReplyMarkup = None,
parse_mode: ODVInput[str] = DEFAULT_NONE,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: int = None,
*,
Expand Down Expand Up @@ -2554,7 +2554,7 @@ async def send_poll(
self,
chat_id: Union[int, str],
question: str,
options: List[str],
options: Sequence[str],
is_anonymous: bool = None,
type: str = None, # pylint: disable=redefined-builtin
allows_multiple_answers: bool = None,
Expand All @@ -2568,7 +2568,7 @@ async def send_poll(
open_period: int = None,
close_date: Union[int, datetime] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
explanation_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
explanation_entities: Sequence["MessageEntity"] = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: int = None,
*,
Expand Down Expand Up @@ -2705,7 +2705,7 @@ async def send_video(
supports_streaming: bool = None,
thumb: FileInput = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: int = None,
*,
Expand Down Expand Up @@ -2795,7 +2795,7 @@ async def send_voice(
reply_markup: ReplyMarkup = None,
parse_mode: ODVInput[str] = DEFAULT_NONE,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
caption_entities: Union[List["MessageEntity"], Tuple["MessageEntity", ...]] = None,
caption_entities: Sequence["MessageEntity"] = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: int = None,
*,
Expand Down Expand Up @@ -3018,7 +3018,7 @@ async def set_game_score(

async def set_my_commands(
self,
commands: List[Union[BotCommand, Tuple[str, str]]],
commands: Sequence[Union[BotCommand, Tuple[str, str]]],
scope: BotCommandScope = None,
language_code: str = None,
*,
Expand Down Expand Up @@ -3065,7 +3065,7 @@ async def set_my_default_administrator_rights(
async def set_passport_data_errors(
self,
user_id: Union[str, int],
errors: List[PassportElementError],
errors: Sequence[PassportElementError],
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -3135,7 +3135,7 @@ async def set_webhook(
url: str,
certificate: FileInput = None,
max_connections: int = None,
allowed_updates: List[str] = None,
allowed_updates: Sequence[str] = None,
ip_address: str = None,
drop_pending_updates: bool = None,
secret_token: str = None,
Expand Down

0 comments on commit 93fac62

Please sign in to comment.