|
18 | 18 |
|
19 | 19 | import inspect |
20 | 20 | import re |
21 | | -from typing import Any, Callable, List, Literal, Optional, Pattern, Union |
| 21 | +from typing import Any, Callable, Literal, Optional, Pattern, Union |
22 | 22 |
|
23 | 23 | import pyrogram |
24 | 24 | from pyrogram import enums |
@@ -804,7 +804,7 @@ async def video_chat_ended_filter(_, __, m: Message) -> bool: |
804 | 804 |
|
805 | 805 |
|
806 | 806 | # region business message |
807 | | -async def tg_business_filter(_, __, m: Union[Message, List[Message]]): |
| 807 | +async def tg_business_filter(_, __, m: Union[Message, list[Message]]): |
808 | 808 | if ( |
809 | 809 | isinstance(m, list) and |
810 | 810 | len(m) > 0 |
@@ -916,8 +916,8 @@ async def linked_channel_filter(_, __, m: Message) -> bool: |
916 | 916 |
|
917 | 917 | # region command_filter |
918 | 918 | def command( |
919 | | - commands: Union[str, List[str]], |
920 | | - prefixes: Union[str, List[str]] = "/", |
| 919 | + commands: Union[str, list[str]], |
| 920 | + prefixes: Union[str, list[str]] = "/", |
921 | 921 | case_sensitive: bool = False, |
922 | 922 | ) -> Filter: |
923 | 923 | """Filter commands, i.e.: text messages starting with "/" or any other custom prefix. |
@@ -1007,13 +1007,13 @@ async def func(flt, client: pyrogram.Client, message: Message) -> bool: |
1007 | 1007 |
|
1008 | 1008 |
|
1009 | 1009 | # region cq_data_filter |
1010 | | -def cq_data(data: Union[str, List[str]]): |
| 1010 | +def cq_data(data: Union[str, list[str]]): |
1011 | 1011 | """Filter callback query updates that match a given string or list of strings. |
1012 | 1012 |
|
1013 | 1013 | Can be applied to handlers that receive :obj:`~pyrogram.types.CallbackQuery` updates. |
1014 | 1014 |
|
1015 | 1015 | Parameters: |
1016 | | - data (``str`` | ``List[str]``): |
| 1016 | + data (``str`` | ``list[str]``): |
1017 | 1017 | The data or list of data strings to match against the callback query. |
1018 | 1018 |
|
1019 | 1019 | Returns: |
@@ -1096,7 +1096,7 @@ class user(Filter, set): |
1096 | 1096 | Defaults to None (no users). |
1097 | 1097 | """ |
1098 | 1098 |
|
1099 | | - def __init__(self, users: Optional[Union[int, str, List[Union[int, str]]]] = None) -> None: |
| 1099 | + def __init__(self, users: Optional[Union[int, str, list[Union[int, str]]]] = None) -> None: |
1100 | 1100 | users = [] if users is None else users if isinstance(users, list) else [users] |
1101 | 1101 |
|
1102 | 1102 | super().__init__( |
@@ -1133,7 +1133,7 @@ class chat(Filter, set): |
1133 | 1133 | Defaults to None (no chats). |
1134 | 1134 | """ |
1135 | 1135 |
|
1136 | | - def __init__(self, chats: Optional[Union[int, str, List[Union[int, str]]]] = None) -> None: |
| 1136 | + def __init__(self, chats: Optional[Union[int, str, list[Union[int, str]]]] = None) -> None: |
1137 | 1137 | chats = [] if chats is None else chats if isinstance(chats, list) else [chats] |
1138 | 1138 |
|
1139 | 1139 | super().__init__( |
@@ -1194,7 +1194,7 @@ class thread(Filter, set): |
1194 | 1194 | Defaults to None (no threads). |
1195 | 1195 | """ |
1196 | 1196 |
|
1197 | | - def __init__(self, message_thread_ids: Optional[Union[int, List[int]]] = None): |
| 1197 | + def __init__(self, message_thread_ids: Optional[Union[int, list[int]]] = None): |
1198 | 1198 | message_thread_ids = [] if message_thread_ids is None else message_thread_ids if isinstance(message_thread_ids, list) else [message_thread_ids] |
1199 | 1199 |
|
1200 | 1200 | super().__init__( |
|
0 commit comments