Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest commits #18

Closed
wants to merge 64 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6acc39a
Change bug report template to an issue form
9ary May 29, 2023
9751b35
Change feature request template to an issue form
9ary May 29, 2023
ed825a2
Add dedicated form for documentation issues
9ary May 29, 2023
c89644e
Update some fields in the GH issue template
Lonami May 30, 2023
0f0ca6b
Upgrade issue templates to issue forms (#4118)
Lonami May 30, 2023
aab8009
Fix comment_to for a group of messages (#4120)
iamilya May 31, 2023
c3ec775
Clarify OS field in bug report template
9ary Jun 2, 2023
4ff7ac6
Handle CancelledError inside mtprotosender recv loop
Lonami Jun 2, 2023
c3bddf9
Add missing formatting arg in logging call
Lonami Jun 2, 2023
65407fc
Document more RPC errors (#4127)
New-dev0 Jun 6, 2023
2826c94
Support most usernames in VALID_USERNAME_RE
Lonami Jun 9, 2023
1e63de9
Fix lack of support for anon channel restrictions (#4130)
rozha Jun 9, 2023
9267917
Improve error message when trying to delete inline messages
Lonami Jun 9, 2023
16ed961
Change html.unparse logic to mimic markdown's
Lonami Jun 17, 2023
75ed58a
Update to layer 160
Lonami Jul 21, 2023
164d356
Fix reply_to can be optional
Lonami Jul 21, 2023
816b0bd
Fix _get_thumb failed when document had no thumbs
Lonami Jul 21, 2023
a0cda0c
Remove client-side checks when editing permissions
Lonami Jul 21, 2023
4eef9b5
Handle sqlite3.OperationalError in update loop
Lonami Jul 21, 2023
438aff3
Handle FloodWaitError in update loop
Lonami Jul 21, 2023
131f021
Don't attempt thumb download if there is no thumb
Lonami Jul 22, 2023
9cf4cd7
Disable blank issues in GitHub (#4157)
9ary Jul 23, 2023
413a2bb
Bump to v1.29.0
Lonami Jul 23, 2023
ce010e9
Fix handling of UpdateShortSentMessage
Lonami Jul 23, 2023
694c78c
Improve image compression heuristics and algorithm used (#4158)
Nick80835 Jul 23, 2023
211238f
Fix reply_to when sending albums
Lonami Jul 24, 2023
6ded164
Sort tlobjects before generating their listing (#4163)
bmwiedemann Aug 1, 2023
128b707
Don't treat asyncio.IncompleteReadError as unhandled
Lonami Aug 3, 2023
b0f9fd1
Except all types of timeout error
Lonami Aug 18, 2023
e617b59
Return marked ID from MemorySession.get_entity_rows_by_id (#4177)
Kacnep89 Aug 23, 2023
0cc9ca9
Fix `is_inline` check for `KeyboardButtonWebView` (#4183)
misuzu Aug 28, 2023
2011a32
Make MessageBox trace logs more useful
Lonami Aug 29, 2023
574e887
Fix getting_diff_for with empty set was being spammed
Lonami Aug 29, 2023
d40aae7
Further improve MessageBox trace logging
Lonami Aug 29, 2023
ac483e6
Only update seq if pts changed
Lonami Aug 29, 2023
33f3e27
Change apply_deadlines_reset micro-optimization
Lonami Aug 29, 2023
72f16ef
Update to layer 161
Lonami Aug 29, 2023
9b1d9aa
Fix incorrect param type in apply_channel_difference (#4185)
kshubham506 Aug 29, 2023
e928fbd
Fix date empty (#4191)
Kacnep89 Sep 6, 2023
72faa89
Remove client-side check in message.edit (#4195)
NotStatilko Sep 8, 2023
ba99b8b
Update to layer 162
Lonami Sep 10, 2023
2cef715
Bump to v1.30
Lonami Sep 10, 2023
5ba3125
Fix generator for pypy (#4198)
gumblex Sep 12, 2023
7ce0b2f
Fix invalid date type in UpdateShort
Lonami Sep 12, 2023
7325718
Fix date empty when getting difference
Lonami Sep 13, 2023
ad19987
Fixed sorting of markup entities with the same offsets (#4201)
alexgoryushkin Sep 14, 2023
bd11564
Remove uses of imghdr
Lonami Sep 20, 2023
6a36066
Update to layer 164
Lonami Sep 22, 2023
7d7dbdf
Update to layer 165
Lonami Sep 29, 2023
eb67ef1
Update to v1.31
Lonami Oct 12, 2023
fda6840
Fix file name could be lost when uploading files
Lonami Oct 17, 2023
046dbb5
Update to layer 166
Lonami Oct 29, 2023
b17e10a
Fix init of custom Draft after layer update
Lonami Oct 29, 2023
6ccd6b0
Bump to v1.32
Lonami Oct 31, 2023
308f8e8
Add PR template mentioning v1 is feature-frozen
Lonami Nov 9, 2023
ddc9bef
Force filename with JPG extension after resizing
Lonami Nov 12, 2023
cf3bc71
Retry on TimedOutError (#4255)
mario-ttide Nov 19, 2023
584735a
Conditional webbrowser import (#4261)
balika011 Nov 27, 2023
1ef6689
Update to layer 167
Lonami Dec 1, 2023
985d12e
Bump to v1.33
Lonami Dec 1, 2023
abeb8c4
Prioritise closing tags when sorting tags
udf Dec 7, 2023
3b428f9
Fix ordering of nested entities
udf Dec 7, 2023
3d58dc3
Fix ordering of closing tags of sequential entities (#4268)
Lonami Dec 8, 2023
6cf1be9
Bump to v1.33.1
Lonami Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions .github/ISSUE_TEMPLATE/bug-report.md

This file was deleted.

96 changes: 96 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Bug Report
description: Create a report about a bug inside the library.
body:

- type: textarea
id: reproducing-example
attributes:
label: Code that causes the issue
description: Provide a code example that reproduces the problem. Try to keep it short without other dependencies.
placeholder: |
```python
from telethon.sync import TelegramClient
...

```
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: Explain what you should expect to happen. Include reproduction steps.
placeholder: |
"I was doing... I was expecting the following to happen..."
validations:
required: true

- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: Explain what actually happens.
placeholder: |
"This happened instead..."
validations:
required: true

- type: textarea
id: traceback
attributes:
label: Traceback
description: |
The traceback, if the problem is a crash.
placeholder: |
```
Traceback (most recent call last):
File "code.py", line 1, in <code>

```

- type: input
id: telethon-version
attributes:
label: Telethon version
description: The output of `python -c "import telethon; print(telethon.__version__)"`.
placeholder: "1.x"
validations:
required: true

- type: input
id: python-version
attributes:
label: Python version
description: The output of `python --version`.
placeholder: "3.x"
validations:
required: true

- type: input
id: os
attributes:
label: Operating system (including distribution name and version)
placeholder: Windows 11, macOS 13.4, Ubuntu 23.04...
validations:
required: true

- type: textarea
id: other-details
attributes:
label: Other details
placeholder: |
Additional details and attachments. Is it a server? Network condition?

- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
options:
- label: The error is in the library's code, and not in my own.
required: true
- label: I have searched for this issue before posting it and there isn't an open duplicate.
required: true
- label: I ran `pip install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip` and triggered the bug in the latest version.
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
blank_issues_enabled: false
contact_links:
- name: Ask questions in StackOverflow
url: https://stackoverflow.com/questions/ask?tags=telethon
Expand Down
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Documentation Issue
description: Report a problem with the documentation.
labels: [documentation]
body:

- type: textarea
id: description
attributes:
label: Description
description: Describe the problem in detail.
placeholder: This part is unclear...

- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
options:
- label: This is a documentation problem, not a question or a bug report.
required: true
- label: I have searched for this issue before posting it and there isn't a duplicate.
required: true
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/feature-request.md

This file was deleted.

22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Feature Request
description: Suggest ideas, changes or other enhancements for the library.
labels: [enhancement]
body:

- type: textarea
id: feature-description
attributes:
label: Describe your suggested feature
description: Please describe your idea. Would you like another friendly method? Renaming them to something more appropriate? Changing the way something works?
placeholder: "It should work like this..."
validations:
required: true

- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
options:
- label: I have searched for this issue before posting it and there isn't a duplicate.
required: true
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
Thanks for the PR! Please keep in mind that v1 is *feature frozen*.
New features very likely won't be merged, although fixes can be sent.
All new development should happen in v2. Thanks!
-->
149 changes: 149 additions & 0 deletions readthedocs/misc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,155 @@ it can take advantage of new goodies!

.. contents:: List of All Versions

New layer (v1.33)
=================

+------------------------+
| Scheme layer used: 167 |
+------------------------+

`View new and changed raw API methods <https://diff.telethon.dev/?from=166&to=167>`__.

Enhancements
~~~~~~~~~~~~

* ``webbrowser`` is now imported conditionally, to support niche environments.
* Library should now retry on the suddenly-common ``TimedOutError``.

Bug fixes
~~~~~~~~~

* Sending photos which were automatically resized should work again (included in the v1.32 series).


New layer (v1.32)
=================

+------------------------+
| Scheme layer used: 166 |
+------------------------+

`View new and changed raw API methods <https://diff.telethon.dev/?from=165&to=166>`__.

This enables you to use custom languages in preformatted blocks using HTML:

.. code-block:: html

<pre>
<code class='language-python'>from telethon import TelegramClient</code>
</pre>

Note that Telethon v1's markdown is a custom format and won't support language tags.
If you want to set a custom language, you have to use HTML or a custom formatter.


Dropped imghdr support (v1.31)
==============================

+------------------------+
| Scheme layer used: 165 |
+------------------------+

This release contains a breaking change in preparation for Python 3.12.
If you were sending photos from in-memory ``bytes`` or ``BytesIO`` containing images,
you should now use ``BytesIO`` and set the ``.name`` property to a dummy name.
This will allow Telethon to detect the correct extension (and file type).

.. code-block:: python

# before
image_data = b'...'
client.send_file(chat, image_data)

# after
from io import BytesIO
image_data = BytesIO(b'...')
image_data.name = 'a.jpg' # any name, only the extension matters
client.send_file(chat, image_data)


Bug fixes
~~~~~~~~~

* Code generation wasn't working under PyPy.
* Obtaining markdown or HTML from message text could produce unexpected results sometimes.
* Other fixes for bugs from the previous version, which were already fixed in patch versions.

Breaking Changes
~~~~~~~~~~~~~~~~

* ``imghdr`` is deprecated in newer Python versions, so Telethon no longer uses it.
This means there might be some cases where Telethon fails to infer the file extension for buffers containing images.
If you were relying on this, add ``.name = 'a.jpg'`` (or other extension) to the ``BytesIO`` buffers you upload.

Layer bump and small changes (v1.30)
====================================

+------------------------+
| Scheme layer used: 162 |
+------------------------+

Some of the bug fixes were already present in patch versions of ``v1.29``, but
the new layer necessitated a minor bump.

Enhancements
~~~~~~~~~~~~

* Removed client-side checks for editing messages.
This only affects ``Message.edit``, as ``client.edit_message`` already had
no checks.
* Library should not understand more server-side errors during update handling
which should reduce crashes.
* Client-side image compression should behave better now.

Bug fixes
~~~~~~~~~

* Some updates such as ``UpdateChatParticipant`` were being missed due to the
order in which Telegram sent them. The library now more carefully checks for
the sequence and pts contained in them to avoid dropping them.
* Fixed ``is_inline`` check for :tl:`KeyboardButtonWebView`.
* Fixed some issues getting entity from cache by ID.
* ``reply_to`` should now work when sending albums.


More bug fixing (v1.29)
=======================

+------------------------+
| Scheme layer used: 160 |
+------------------------+

This layer introduces the necessary raw API methods to work with stories.

The library is aiming to be "feature-frozen" for as long as v1 is active,
so friendly client methods are not implemented, but example code to use
stories can be found in the GitHub wiki of the project.

Enhancements
~~~~~~~~~~~~

* Removed client-side checks for methods dealing with chat permissions.
In particular, this means you can now ban channels.
* Improved some error messages and added new classes for more RPC errors.
* The client-side check for valid usernames has been loosened, so that
very short premium usernames are no longer considered invalid.

Bug fixes
~~~~~~~~~

* Attempting to download a thumbnail from documnets without one would fail,
rather than do nothing (since nothing can be downloaded if there is no thumb).
* More errors are caught in the update handling loop.
* HTML ``.text`` should now "unparse" any message contents correctly.
* Fixed some problems related to logging.
* ``comment_to`` should now work as expected with albums.
* ``asyncio.CancelledError`` should now correctly propagate from the update loop.
* Removed some absolute imports in favour of relative imports.
* ``UserUpdate.last_seen`` should now behave correctly.
* Fixed a rare ``ValueError`` during ``connect`` if the session cache was bad.


New Layer and housekeeping (v1.28)
==================================

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ def main(argv):
# Try importing the telethon module to assert it has no errors
try:
import telethon
except:
except Exception as e:
print('Packaging for PyPi aborted, importing the module failed.')
print(e)
return

remove_dirs = ['__pycache__', 'build', 'dist', 'Telethon.egg-info']
Expand Down
Loading