Skip to content

Commit

Permalink
Conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
New-dev0 committed Jun 20, 2023
2 parents c1a7454 4921e36 commit dd09e0b
Show file tree
Hide file tree
Showing 13 changed files with 209 additions and 142 deletions.
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
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
4 changes: 2 additions & 2 deletions telethon/client/chats.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 1115,8 @@ async def edit_permissions(

user = await self.get_input_entity(user)
ty = helpers._entity_type(user)
if ty != helpers._EntityType.USER:
raise ValueError('You must pass a user entity')
if ty not in (helpers._EntityType.USER, helpers._EntityType.CHANNEL):
raise ValueError('You must pass a user or channel entity')

if isinstance(user, types.InputPeerSelf):
raise ValueError('You cannot restrict yourself')
Expand Down
2 changes: 1 addition & 1 deletion telethon/client/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 605,7 @@ async def _get_comment_data(
peer=entity,
msg_id=utils.get_message_id(message)
))
m = r.messages[0]
m = min(r.messages, key=lambda msg: msg.id)
chat = next(c for c in r.chats if c.id == m.peer_id.channel_id)
return utils.get_input_peer(chat), m.id

Expand Down
5 changes: 2 additions & 3 deletions telethon/client/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 300,7 @@ async def _update_loop(self: 'TelegramClient'):
)


get_diff = self._message_box.get_difference()
if get_diff:
if get_diff := self._message_box.get_difference():
self._log[__name__].debug('Getting difference for account updates')
try:
diff = await self(get_diff)
Expand Down Expand Up @@ -364,7 363,7 @@ async def _update_loop(self: 'TelegramClient'):
continue
except errors.TypeNotFoundError as e:
self._log[__name__].warning(
'Cannot get difference since the account is likely misusing the session: %s',
'Cannot get difference for channel %s since the account is likely misusing the session: %s',
get_diff.channel.channel_id, e
)
self._message_box.end_channel_difference(
Expand Down
2 changes: 2 additions & 0 deletions telethon/events/callbackquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 335,8 @@ async def delete(self, *args, **kwargs):
This method will likely fail if `via_inline` is `True`.
"""
self._client.loop.create_task(self.answer())
if isinstance(self.query.msg_id, (types.InputBotInlineMessageID, types.InputBotInlineMessageID64)):
raise TypeError('Inline messages cannot be deleted as there is no API request available to do so')
return await self._client.delete_messages(
await self.get_input_chat(), [self.query.msg_id],
*args, **kwargs
Expand Down
Loading

0 comments on commit dd09e0b

Please sign in to comment.