Commit Graph

509 Commits

Author SHA1 Message Date
Serhii Dylda
633986cfa6 Replace PySocks with python-socks for Python >= 3.6
See discussion at (https://github.com/LonamiWebs/Telethon/pull/1623)

Small fixes for `local_addr` argument.
2020-11-09 19:59:54 +01:00
Richard
ba3a090a80
Update send_file to support grouping any file type (#1620) 2020-11-07 17:32:00 +01:00
Lonami Exo
a6781c8e34 Don't cache SLOW_MODE_WAIT in _flood_waited_requests
Closes #1600.
2020-11-07 12:09:00 +01:00
vegeta1k95
39e899294f
Fix unhandled ValueError inside _dispatch_update() task (#1615) 2020-11-04 09:58:20 +01:00
Lonami Exo
64d751a397 messages.search from_user may now be a non-User 2020-10-31 11:41:37 +01:00
Lonami Exo
935ee2242d Add method to unpin messages 2020-10-31 11:31:09 +01:00
Lonami Exo
d83c154f8d Partial update to layer 120 2020-10-30 20:06:59 +01:00
Lonami Exo
e7f174cdc8 Fix search with offset_date causing infinite recursion
Bug introduced by 668dcd5. Closes #1606.
2020-10-25 10:33:36 +01:00
Lonami Exo
62467b6318 Fix yet another typo
Never make commits in a rush from your phone.
2020-10-23 21:27:39 +02:00
Lonami Exo
60c5d0d8f4 Fix up typo from last commit 2020-10-23 21:24:51 +02:00
Lonami Exo
1a2e09487c Fix utils.get_peer not handling Self in get_messages 2020-10-23 19:02:43 +02:00
Lonami Exo
44e2ef6c79 Don't error when failing to extract response messages 2020-10-23 11:02:30 +02:00
Qwerty-Space
d56b27e570
Fix several minor typos (#1603) 2020-10-18 21:11:59 +02:00
Lonami Exo
4db51dff8a Update to v1.17 2020-10-18 14:11:52 +02:00
Lonami Exo
5952a40c6d Update iter_messages to support fetching channel comments
Closes #1598.
2020-10-16 10:39:02 +02:00
Lonami Exo
4e1f582b17 Call sign_in during sign_up if needed to send the code 2020-10-15 11:43:35 +02:00
Lonami Exo
adf52a1b74 Expose entity parameter in client.inline_query
Some bots, such as @gamee, use this to determine the type of results
to return (and "disable" themselves in channels).
2020-10-11 16:59:48 +02:00
vegeta1k95
d0faaa2ead
Fix internal get_me() was not expecting network errors (#1594) 2020-10-11 09:33:05 +02:00
Lonami Exo
61b0f09e1d Fix iter_messages(from_users='me') 2020-10-09 21:14:31 +02:00
Stefan
d2756cf68f
Add support for local_ip address binding (#1587) 2020-10-07 10:03:19 +02:00
Lonami Exo
cf1645b598 Improve documentation for ParticipantPermissions 2020-10-06 11:14:16 +02:00
Lonami Exo
7f61b92f81 Add anonymous permission to edit_admin and get_permissions 2020-10-06 11:14:16 +02:00
Nick80835
ce120cba13
Fix get_permissions in chats and when using self user (#1584) 2020-10-05 19:21:07 +02:00
Lonami Exo
cb92a40156 Add additional asserts to debug issue with peer empty channels 2020-10-05 13:58:04 +02:00
kolay
fc765f6014
Add new get_permissions method (#1575)
Closes #1574.
2020-10-03 16:59:54 +02:00
Tulir Asokan
bf29cddbc9
Add parameter to pass raw entities when sending message (#1577) 2020-10-02 22:06:48 +02:00
Lonami Exo
4321153b06 Correctly emulate old to_id behaviour 2020-10-02 10:23:04 +02:00
Lonami Exo
233daafd96 Fix global search would fail if last message had no peer 2020-10-01 13:18:54 +02:00
Lonami Exo
668dcd52ca Update global search to properly use offset_rate 2020-10-01 12:23:34 +02:00
Tulir Asokan
8ce7e776c1 Add option to raise last error instead of generic ValueError (#1571) 2020-10-01 12:23:10 +02:00
Lonami Exo
d5e4398ace Adapt the rest of the library to layer 119 2020-10-01 12:22:55 +02:00
Lonami Exo
c864ef7e16 Refetch msg if fileref expires while downloading docs
Closes #1301.
2020-09-24 10:03:28 +02:00
Lonami Exo
75fbd28d3e Add a workaround for sometimes-missing photos from channels 2020-09-22 11:08:17 +02:00
Lonami Exo
219b4ecb77 Abstract away treating a file as a stream
Makes upload_file cleaner (context manager instead of try-finally)
and helps keep the logic "we may own this stream and need to close
it or not" separated.

It can be overengineered to allow nesting the same instance in
context managers and also provide implementations for synchronous
context managers but it adds quite a bit of unnecessary complexity
for the time being. YAGNI.
2020-09-14 16:20:44 +02:00
yash-dk
1d6fd7898a
Consider all reconnect attempts as retrying (#1557)
This means that a value of 0 retries will no longer try to reconnect.
2020-09-13 09:43:01 +02:00
apepenkov
2a114917f1
Fix AlbumHack in combination with events.Raw (#1555) 2020-09-10 16:25:44 +02:00
Tanya Degurechaff
1afb5b95e3
Update init params to match those of tdesktop (#1549) 2020-09-10 14:52:25 +02:00
penn5
1a9accbe5d
Fix warning when using formatted phones in start (#1532) 2020-08-24 10:53:29 +02:00
Lonami Exo
73109eb819 Add a workaround for channels that claim have no photos but do 2020-08-13 15:13:29 +02:00
Lonami Exo
e19aa44d5c Sort thumbs to ensure -1 is largest
Closes #1519.
2020-08-11 23:14:31 +02:00
Lonami Exo
0cefc73448 Support both str and VideoSize as thumb on download_media 2020-08-11 22:31:12 +02:00
Lonami Exo
9a0d6b9931 Don't set force_file on force_document with images
Otherwise, Telegram won't analyze the image and won't add it the
DocumentAttributeImageSize, causing some bots like t.me/Stickers
to break.

Closes #1507.
2020-08-10 16:09:39 +02:00
Lonami Exo
ddeefff431 Add a warning when trying to connect to a different account
Closes #1172, and also fixed a typo.
2020-08-08 17:49:00 +02:00
conetra
958698bba7
Remove square bracket around IPv6 addresses (#1517) 2020-08-08 13:16:01 +02:00
Lonami Exo
241c6c4ac8 Auto-retry on interdc call (rich) error 2020-08-03 12:35:25 +02:00
Lonami Exo
f18ab08334 Add new friendly method to get channel stats 2020-07-26 13:45:30 +02:00
Lonami Exo
e12f6c747f Extend use of force_document to work on files
This allows .webp files to be sent as documents and not stickers.
2020-07-26 13:03:59 +02:00
Lonami Exo
95ea2fb40c Remove uses of gif external
Since it has been removed in layer 116.
2020-07-26 12:59:10 +02:00
Lonami Exo
1c3e7dda01 Avoid explicitly passing the loop to asyncio
This behaviour is deprecated and will be removed in future versions
of Python. Technically, it could be considered a bug (invalid usage
causing different behaviour from the expected one), and in practice
it should not break much code (because .get_event_loop() would likely
be the same event loop anyway).
2020-07-25 18:39:35 +02:00
Lonami Exo
de17a19168 Improve upload_file by properly supporting streaming files 2020-07-15 14:35:42 +02:00