Rename Entity type hint

This commit is contained in:
Lonami Exo 2022-03-02 12:38:59 +01:00
parent c3cefef37c
commit 68d07beb21
9 changed files with 77 additions and 77 deletions

View File

@ -10,10 +10,10 @@ if typing.TYPE_CHECKING:
async def inline_query( async def inline_query(
self: 'TelegramClient', self: 'TelegramClient',
bot: 'hints.EntityLike', bot: 'hints.DialogLike',
query: str, query: str,
*, *,
dialog: 'hints.EntityLike' = None, dialog: 'hints.DialogLike' = None,
offset: str = None, offset: str = None,
geo_point: '_tl.GeoPoint' = None) -> _custom.InlineResults: geo_point: '_tl.GeoPoint' = None) -> _custom.InlineResults:
bot = await self.get_input_entity(bot) bot = await self.get_input_entity(bot)

View File

@ -372,7 +372,7 @@ class _ProfilePhotoIter(requestiter.RequestIter):
def get_participants( def get_participants(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
limit: float = (), limit: float = (),
*, *,
search: str = '', search: str = '',
@ -388,13 +388,13 @@ def get_participants(
def get_admin_log( def get_admin_log(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
limit: float = (), limit: float = (),
*, *,
max_id: int = 0, max_id: int = 0,
min_id: int = 0, min_id: int = 0,
search: str = None, search: str = None,
admins: 'hints.EntitiesLike' = None, admins: 'hints.DialogsLike' = None,
join: bool = None, join: bool = None,
leave: bool = None, leave: bool = None,
invite: bool = None, invite: bool = None,
@ -438,7 +438,7 @@ def get_admin_log(
def get_profile_photos( def get_profile_photos(
self: 'TelegramClient', self: 'TelegramClient',
profile: 'hints.EntityLike', profile: 'hints.DialogLike',
limit: int = (), limit: int = (),
*, *,
offset: int = 0, offset: int = 0,
@ -454,7 +454,7 @@ def get_profile_photos(
def action( def action(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
action: 'typing.Union[str, _tl.TypeSendMessageAction]', action: 'typing.Union[str, _tl.TypeSendMessageAction]',
*, *,
delay: float = 4, delay: float = 4,
@ -466,8 +466,8 @@ def action(
async def edit_admin( async def edit_admin(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
user: 'hints.EntityLike', user: 'hints.DialogLike',
*, *,
change_info: bool = None, change_info: bool = None,
post_messages: bool = None, post_messages: bool = None,
@ -529,8 +529,8 @@ async def edit_admin(
async def edit_permissions( async def edit_permissions(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
user: 'typing.Optional[hints.EntityLike]' = None, user: 'typing.Optional[hints.DialogLike]' = None,
until_date: 'hints.DateLike' = None, until_date: 'hints.DateLike' = None,
*, *,
view_messages: bool = True, view_messages: bool = True,
@ -583,8 +583,8 @@ async def edit_permissions(
async def kick_participant( async def kick_participant(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
user: 'typing.Optional[hints.EntityLike]' user: 'typing.Optional[hints.DialogLike]'
): ):
entity = await self.get_input_entity(chat) entity = await self.get_input_entity(chat)
user = await self.get_input_entity(user) user = await self.get_input_entity(user)
@ -617,8 +617,8 @@ async def kick_participant(
async def get_permissions( async def get_permissions(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
user: 'hints.EntityLike' = None user: 'hints.DialogLike' = None
) -> 'typing.Optional[_custom.ParticipantPermissions]': ) -> 'typing.Optional[_custom.ParticipantPermissions]':
entity = await self.get_entity(chat) entity = await self.get_entity(chat)
@ -650,7 +650,7 @@ async def get_permissions(
async def get_stats( async def get_stats(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
message: 'typing.Union[int, _tl.Message]' = None, message: 'typing.Union[int, _tl.Message]' = None,
): ):
entity = await self.get_input_entity(chat) entity = await self.get_input_entity(chat)

View File

@ -146,7 +146,7 @@ def get_dialogs(
*, *,
offset_date: 'hints.DateLike' = None, offset_date: 'hints.DateLike' = None,
offset_id: int = 0, offset_id: int = 0,
offset_peer: 'hints.EntityLike' = _tl.InputPeerEmpty(), offset_peer: 'hints.DialogLike' = _tl.InputPeerEmpty(),
ignore_pinned: bool = False, ignore_pinned: bool = False,
ignore_migrated: bool = False, ignore_migrated: bool = False,
folder: int = None, folder: int = None,
@ -165,7 +165,7 @@ def get_dialogs(
def get_drafts( def get_drafts(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntitiesLike' = None dialog: 'hints.DialogsLike' = None
) -> _DraftsIter: ) -> _DraftsIter:
limit = None limit = None
if dialog: if dialog:
@ -178,7 +178,7 @@ def get_drafts(
async def delete_dialog( async def delete_dialog(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
*, *,
revoke: bool = False revoke: bool = False
): ):

View File

@ -178,7 +178,7 @@ class _GenericDownloadIter(_DirectDownloadIter):
async def download_profile_photo( async def download_profile_photo(
self: 'TelegramClient', self: 'TelegramClient',
profile: 'hints.EntityLike', profile: 'hints.DialogLike',
file: 'hints.FileLike' = None, file: 'hints.FileLike' = None,
*, *,
thumb, thumb,

View File

@ -322,7 +322,7 @@ class _IDsIter(requestiter.RequestIter):
self.buffer.append(_custom.Message._new(self.client, message, entities, self._entity)) self.buffer.append(_custom.Message._new(self.client, message, entities, self._entity))
async def _get_peer(self: 'TelegramClient', input_peer: 'hints.EntityLike'): async def _get_peer(self: 'TelegramClient', input_peer: 'hints.DialogLike'):
try: try:
return utils.get_peer(input_peer) return utils.get_peer(input_peer)
except TypeError: except TypeError:
@ -332,7 +332,7 @@ async def _get_peer(self: 'TelegramClient', input_peer: 'hints.EntityLike'):
def get_messages( def get_messages(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
limit: float = (), limit: float = (),
*, *,
offset_date: 'hints.DateLike' = None, offset_date: 'hints.DateLike' = None,
@ -342,7 +342,7 @@ def get_messages(
add_offset: int = 0, add_offset: int = 0,
search: str = None, search: str = None,
filter: 'typing.Union[_tl.TypeMessagesFilter, typing.Type[_tl.TypeMessagesFilter]]' = None, filter: 'typing.Union[_tl.TypeMessagesFilter, typing.Type[_tl.TypeMessagesFilter]]' = None,
from_user: 'hints.EntityLike' = None, from_user: 'hints.DialogLike' = None,
wait_time: float = None, wait_time: float = None,
ids: 'typing.Union[int, typing.Sequence[int]]' = None, ids: 'typing.Union[int, typing.Sequence[int]]' = None,
reverse: bool = False, reverse: bool = False,
@ -383,7 +383,7 @@ def get_messages(
async def _get_comment_data( async def _get_comment_data(
self: 'TelegramClient', self: 'TelegramClient',
entity: 'hints.EntityLike', entity: 'hints.DialogLike',
message: 'typing.Union[int, _tl.Message]' message: 'typing.Union[int, _tl.Message]'
): ):
r = await self(_tl.fn.messages.GetDiscussionMessage( r = await self(_tl.fn.messages.GetDiscussionMessage(
@ -396,7 +396,7 @@ async def _get_comment_data(
async def send_message( async def send_message(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
message: 'hints.MessageLike' = '', message: 'hints.MessageLike' = '',
*, *,
# - Message contents # - Message contents
@ -428,7 +428,7 @@ async def send_message(
ttl: int = None, ttl: int = None,
# - Send options # - Send options
reply_to: 'typing.Union[int, _tl.Message]' = None, reply_to: 'typing.Union[int, _tl.Message]' = None,
send_as: 'hints.EntityLike' = None, send_as: 'hints.DialogLike' = None,
clear_draft: bool = False, clear_draft: bool = False,
background: bool = None, background: bool = None,
noforwards: bool = None, noforwards: bool = None,
@ -525,9 +525,9 @@ async def send_message(
async def forward_messages( async def forward_messages(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
messages: 'typing.Union[typing.Sequence[hints.MessageIDLike]]', messages: 'typing.Union[typing.Sequence[hints.MessageIDLike]]',
from_dialog: 'hints.EntityLike' = None, from_dialog: 'hints.DialogLike' = None,
*, *,
background: bool = None, background: bool = None,
with_my_score: bool = None, with_my_score: bool = None,
@ -535,7 +535,7 @@ async def forward_messages(
as_album: bool = None, as_album: bool = None,
schedule: 'hints.DateLike' = None, schedule: 'hints.DateLike' = None,
noforwards: bool = None, noforwards: bool = None,
send_as: 'hints.EntityLike' = None send_as: 'hints.DialogLike' = None
) -> 'typing.Sequence[_tl.Message]': ) -> 'typing.Sequence[_tl.Message]':
if as_album is not None: if as_album is not None:
warnings.warn('the as_album argument is deprecated and no longer has any effect') warnings.warn('the as_album argument is deprecated and no longer has any effect')
@ -588,7 +588,7 @@ async def forward_messages(
async def edit_message( async def edit_message(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'typing.Union[hints.EntityLike, _tl.Message]', dialog: 'typing.Union[hints.DialogLike, _tl.Message]',
message: 'hints.MessageLike' = None, message: 'hints.MessageLike' = None,
text: str = None, text: str = None,
*, *,
@ -648,7 +648,7 @@ async def edit_message(
async def delete_messages( async def delete_messages(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
messages: 'typing.Union[typing.Sequence[hints.MessageIDLike]]', messages: 'typing.Union[typing.Sequence[hints.MessageIDLike]]',
*, *,
revoke: bool = True) -> 'typing.Sequence[_tl.messages.AffectedMessages]': revoke: bool = True) -> 'typing.Sequence[_tl.messages.AffectedMessages]':
@ -677,7 +677,7 @@ async def delete_messages(
async def mark_read( async def mark_read(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
message: 'hints.MessageIDLike' = None, message: 'hints.MessageIDLike' = None,
*, *,
clear_mentions: bool = False, clear_mentions: bool = False,
@ -707,7 +707,7 @@ async def mark_read(
async def pin_message( async def pin_message(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
message: 'typing.Optional[hints.MessageIDLike]', message: 'typing.Optional[hints.MessageIDLike]',
*, *,
notify: bool = False, notify: bool = False,
@ -717,7 +717,7 @@ async def pin_message(
async def unpin_message( async def unpin_message(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
message: 'typing.Optional[hints.MessageIDLike]' = None, message: 'typing.Optional[hints.MessageIDLike]' = None,
*, *,
notify: bool = False notify: bool = False
@ -752,7 +752,7 @@ async def _pin(self, entity, message, *, unpin, notify=False, pm_oneside=False):
async def send_reaction( async def send_reaction(
self: 'TelegramClient', self: 'TelegramClient',
entity: 'hints.EntityLike', entity: 'hints.DialogLike',
message: 'hints.MessageIDLike', message: 'hints.MessageIDLike',
reaction: typing.Optional[str] = None, reaction: typing.Optional[str] = None,
big: bool = False big: bool = False

View File

@ -701,10 +701,10 @@ class TelegramClient:
@forward_call(bots.inline_query) @forward_call(bots.inline_query)
async def inline_query( async def inline_query(
self: 'TelegramClient', self: 'TelegramClient',
bot: 'hints.EntityLike', bot: 'hints.DialogLike',
query: str, query: str,
*, *,
dialog: 'hints.EntityLike' = None, dialog: 'hints.DialogLike' = None,
offset: str = None, offset: str = None,
geo_point: '_tl.GeoPoint' = None) -> _custom.InlineResults: geo_point: '_tl.GeoPoint' = None) -> _custom.InlineResults:
""" """
@ -754,7 +754,7 @@ class TelegramClient:
@forward_call(chats.get_participants) @forward_call(chats.get_participants)
def get_participants( def get_participants(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
limit: float = (), limit: float = (),
*, *,
search: str = '', search: str = '',
@ -822,13 +822,13 @@ class TelegramClient:
@forward_call(chats.get_admin_log) @forward_call(chats.get_admin_log)
def get_admin_log( def get_admin_log(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
limit: float = (), limit: float = (),
*, *,
max_id: int = 0, max_id: int = 0,
min_id: int = 0, min_id: int = 0,
search: str = None, search: str = None,
admins: 'hints.EntitiesLike' = None, admins: 'hints.DialogsLike' = None,
join: bool = None, join: bool = None,
leave: bool = None, leave: bool = None,
invite: bool = None, invite: bool = None,
@ -957,7 +957,7 @@ class TelegramClient:
@forward_call(chats.get_profile_photos) @forward_call(chats.get_profile_photos)
def get_profile_photos( def get_profile_photos(
self: 'TelegramClient', self: 'TelegramClient',
profile: 'hints.EntityLike', profile: 'hints.DialogLike',
limit: int = (), limit: int = (),
*, *,
offset: int = 0, offset: int = 0,
@ -1005,7 +1005,7 @@ class TelegramClient:
@forward_call(chats.action) @forward_call(chats.action)
def action( def action(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
action: 'typing.Union[str, _tl.TypeSendMessageAction]', action: 'typing.Union[str, _tl.TypeSendMessageAction]',
*, *,
delay: float = 4, delay: float = 4,
@ -1083,8 +1083,8 @@ class TelegramClient:
@forward_call(chats.edit_admin) @forward_call(chats.edit_admin)
async def edit_admin( async def edit_admin(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
user: 'hints.EntityLike', user: 'hints.DialogLike',
*, *,
change_info: bool = None, change_info: bool = None,
post_messages: bool = None, post_messages: bool = None,
@ -1189,8 +1189,8 @@ class TelegramClient:
@forward_call(chats.edit_permissions) @forward_call(chats.edit_permissions)
async def edit_permissions( async def edit_permissions(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
user: 'typing.Optional[hints.EntityLike]' = None, user: 'typing.Optional[hints.DialogLike]' = None,
until_date: 'hints.DateLike' = None, until_date: 'hints.DateLike' = None,
*, *,
view_messages: bool = True, view_messages: bool = True,
@ -1306,8 +1306,8 @@ class TelegramClient:
@forward_call(chats.kick_participant) @forward_call(chats.kick_participant)
async def kick_participant( async def kick_participant(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
user: 'typing.Optional[hints.EntityLike]' user: 'typing.Optional[hints.DialogLike]'
): ):
""" """
Kicks a user from a chat. Kicks a user from a chat.
@ -1345,8 +1345,8 @@ class TelegramClient:
@forward_call(chats.get_permissions) @forward_call(chats.get_permissions)
async def get_permissions( async def get_permissions(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
user: 'hints.EntityLike' = None user: 'hints.DialogLike' = None
) -> 'typing.Optional[_custom.ParticipantPermissions]': ) -> 'typing.Optional[_custom.ParticipantPermissions]':
""" """
Fetches the permissions of a user in a specific chat or channel or Fetches the permissions of a user in a specific chat or channel or
@ -1383,7 +1383,7 @@ class TelegramClient:
@forward_call(chats.get_stats) @forward_call(chats.get_stats)
async def get_stats( async def get_stats(
self: 'TelegramClient', self: 'TelegramClient',
chat: 'hints.EntityLike', chat: 'hints.DialogLike',
message: 'typing.Union[int, _tl.Message]' = None, message: 'typing.Union[int, _tl.Message]' = None,
): ):
""" """
@ -1437,7 +1437,7 @@ class TelegramClient:
*, *,
offset_date: 'hints.DateLike' = None, offset_date: 'hints.DateLike' = None,
offset_id: int = 0, offset_id: int = 0,
offset_peer: 'hints.EntityLike' = _tl.InputPeerEmpty(), offset_peer: 'hints.DialogLike' = _tl.InputPeerEmpty(),
ignore_pinned: bool = False, ignore_pinned: bool = False,
ignore_migrated: bool = False, ignore_migrated: bool = False,
folder: int = None, folder: int = None,
@ -1523,7 +1523,7 @@ class TelegramClient:
@forward_call(dialogs.get_drafts) @forward_call(dialogs.get_drafts)
def get_drafts( def get_drafts(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntitiesLike' = None dialog: 'hints.DialogsLike' = None
) -> dialogs._DraftsIter: ) -> dialogs._DraftsIter:
""" """
Iterator over draft messages. Iterator over draft messages.
@ -1531,7 +1531,7 @@ class TelegramClient:
The order is unspecified. The order is unspecified.
Arguments Arguments
dialog (`hints.EntitiesLike`, optional): dialog (`hints.DialogsLike`, optional):
The dialog or dialogs for which to fetch the draft messages. The dialog or dialogs for which to fetch the draft messages.
If left unspecified, all draft messages will be returned. If left unspecified, all draft messages will be returned.
@ -1557,7 +1557,7 @@ class TelegramClient:
@forward_call(dialogs.delete_dialog) @forward_call(dialogs.delete_dialog)
async def delete_dialog( async def delete_dialog(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
*, *,
revoke: bool = False revoke: bool = False
): ):
@ -1606,7 +1606,7 @@ class TelegramClient:
@forward_call(downloads.download_profile_photo) @forward_call(downloads.download_profile_photo)
async def download_profile_photo( async def download_profile_photo(
self: 'TelegramClient', self: 'TelegramClient',
profile: 'hints.EntityLike', profile: 'hints.DialogLike',
file: 'hints.FileLike' = None, file: 'hints.FileLike' = None,
*, *,
thumb: typing.Union[str, enums.Size] = (), thumb: typing.Union[str, enums.Size] = (),
@ -1826,7 +1826,7 @@ class TelegramClient:
@forward_call(messages.get_messages) @forward_call(messages.get_messages)
def get_messages( def get_messages(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
limit: float = (), limit: float = (),
*, *,
offset_date: 'hints.DateLike' = None, offset_date: 'hints.DateLike' = None,
@ -1836,7 +1836,7 @@ class TelegramClient:
add_offset: int = 0, add_offset: int = 0,
search: str = None, search: str = None,
filter: 'typing.Union[_tl.TypeMessagesFilter, typing.Type[_tl.TypeMessagesFilter]]' = None, filter: 'typing.Union[_tl.TypeMessagesFilter, typing.Type[_tl.TypeMessagesFilter]]' = None,
from_user: 'hints.EntityLike' = None, from_user: 'hints.DialogLike' = None,
wait_time: float = None, wait_time: float = None,
ids: 'typing.Union[int, typing.Sequence[int]]' = None, ids: 'typing.Union[int, typing.Sequence[int]]' = None,
reverse: bool = False, reverse: bool = False,
@ -2025,7 +2025,7 @@ class TelegramClient:
@forward_call(messages.send_message) @forward_call(messages.send_message)
async def send_message( async def send_message(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
message: 'hints.MessageLike' = '', message: 'hints.MessageLike' = '',
*, *,
# - Message contents # - Message contents
@ -2235,9 +2235,9 @@ class TelegramClient:
@forward_call(messages.forward_messages) @forward_call(messages.forward_messages)
async def forward_messages( async def forward_messages(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
messages: 'typing.Union[typing.Sequence[hints.MessageIDLike]]', messages: 'typing.Union[typing.Sequence[hints.MessageIDLike]]',
from_dialog: 'hints.EntityLike' = None, from_dialog: 'hints.DialogLike' = None,
*, *,
background: bool = None, background: bool = None,
with_my_score: bool = None, with_my_score: bool = None,
@ -2317,7 +2317,7 @@ class TelegramClient:
@forward_call(messages.edit_message) @forward_call(messages.edit_message)
async def edit_message( async def edit_message(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'typing.Union[hints.EntityLike, _tl.Message]', dialog: 'typing.Union[hints.DialogLike, _tl.Message]',
message: 'hints.MessageLike', message: 'hints.MessageLike',
text: str = None, text: str = None,
*, *,
@ -2446,7 +2446,7 @@ class TelegramClient:
@forward_call(messages.delete_messages) @forward_call(messages.delete_messages)
async def delete_messages( async def delete_messages(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
messages: 'typing.Union[typing.Sequence[hints.MessageIDLike]]', messages: 'typing.Union[typing.Sequence[hints.MessageIDLike]]',
*, *,
revoke: bool = True) -> 'typing.Sequence[_tl.messages.AffectedMessages]': revoke: bool = True) -> 'typing.Sequence[_tl.messages.AffectedMessages]':
@ -2498,7 +2498,7 @@ class TelegramClient:
@forward_call(messages.mark_read) @forward_call(messages.mark_read)
async def mark_read( async def mark_read(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
message: 'hints.MessageIDLike' = None, message: 'hints.MessageIDLike' = None,
*, *,
clear_mentions: bool = False) -> bool: clear_mentions: bool = False) -> bool:
@ -2550,7 +2550,7 @@ class TelegramClient:
@forward_call(messages.pin_message) @forward_call(messages.pin_message)
async def pin_message( async def pin_message(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
message: 'typing.Optional[hints.MessageIDLike]', message: 'typing.Optional[hints.MessageIDLike]',
*, *,
notify: bool = False, notify: bool = False,
@ -2591,7 +2591,7 @@ class TelegramClient:
@forward_call(messages.unpin_message) @forward_call(messages.unpin_message)
async def unpin_message( async def unpin_message(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
message: 'typing.Optional[hints.MessageIDLike]' = None, message: 'typing.Optional[hints.MessageIDLike]' = None,
*, *,
notify: bool = False notify: bool = False
@ -2968,7 +2968,7 @@ class TelegramClient:
@forward_call(uploads.send_file) @forward_call(uploads.send_file)
async def send_file( async def send_file(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
file: 'typing.Union[hints.FileLike, typing.Sequence[hints.FileLike]]', file: 'typing.Union[hints.FileLike, typing.Sequence[hints.FileLike]]',
*, *,
caption: typing.Union[str, typing.Sequence[str]] = None, caption: typing.Union[str, typing.Sequence[str]] = None,
@ -3439,7 +3439,7 @@ class TelegramClient:
@forward_call(messages._get_comment_data) @forward_call(messages._get_comment_data)
async def _get_comment_data( async def _get_comment_data(
self: 'TelegramClient', self: 'TelegramClient',
entity: 'hints.EntityLike', entity: 'hints.DialogLike',
message: 'typing.Union[int, _tl.Message]' message: 'typing.Union[int, _tl.Message]'
): ):
pass pass

View File

@ -79,7 +79,7 @@ def _resize_photo_if_needed(
async def send_file( async def send_file(
self: 'TelegramClient', self: 'TelegramClient',
dialog: 'hints.EntityLike', dialog: 'hints.DialogLike',
file: typing.Optional[hints.FileLike] = None, file: typing.Optional[hints.FileLike] = None,
*, *,
# - Message contents # - Message contents
@ -114,7 +114,7 @@ async def send_file(
clear_draft: bool = False, clear_draft: bool = False,
background: bool = None, background: bool = None,
noforwards: bool = None, noforwards: bool = None,
send_as: 'hints.EntityLike' = None, send_as: 'hints.DialogLike' = None,
schedule: 'hints.DateLike' = None, schedule: 'hints.DateLike' = None,
comment_to: 'typing.Union[int, _tl.Message]' = None, comment_to: 'typing.Union[int, _tl.Message]' = None,
) -> '_tl.Message': ) -> '_tl.Message':

View File

@ -8,19 +8,19 @@ from ..types import _custom
Phone = str Phone = str
Username = str Username = str
PeerID = int PeerID = int
Entity = typing.Union[_tl.User, _tl.Chat, _tl.Channel] Dialog = typing.Union[_tl.User, _tl.Chat, _tl.Channel]
FullEntity = typing.Union[_tl.UserFull, _tl.messages.ChatFull, _tl.ChatFull, _tl.ChannelFull] FullDialog = typing.Union[_tl.UserFull, _tl.messages.ChatFull, _tl.ChatFull, _tl.ChannelFull]
EntityLike = typing.Union[ DialogLike = typing.Union[
Phone, Phone,
Username, Username,
PeerID, PeerID,
_tl.TypePeer, _tl.TypePeer,
_tl.TypeInputPeer, _tl.TypeInputPeer,
Entity, Dialog,
FullEntity FullDialog
] ]
EntitiesLike = typing.Union[EntityLike, typing.Sequence[EntityLike]] DialogsLike = typing.Union[DialogLike, typing.Sequence[DialogsLike]]
ButtonLike = typing.Union[_tl.TypeKeyboardButton, _custom.Button] ButtonLike = typing.Union[_tl.TypeKeyboardButton, _custom.Button]
MarkupLike = typing.Union[ MarkupLike = typing.Union[

View File

@ -138,7 +138,7 @@ class Button:
If no `url` is specified, it will default to `text`. If no `url` is specified, it will default to `text`.
Args: Args:
bot (`hints.EntityLike`): bot (`hints.DialogLike`):
The bot that requires this authorization. By default, this The bot that requires this authorization. By default, this
is the bot that is currently logged in (itself), although is the bot that is currently logged in (itself), although
you may pass a different input peer. you may pass a different input peer.