Skip to content

Commit

Permalink
Merge pull request #15 from en9inerd/issue-14
Browse files Browse the repository at this point in the history
issue-14: delete all messages from conversation with user
  • Loading branch information
en9inerd authored Oct 6, 2024
2 parents be1251b + c95f7ed commit fb2f871
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 29 deletions.
54 changes: 27 additions & 27 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
-i https://pypi.org/simple
astroid==3.2.2; python_full_version >= '3.8.0'
astroid==3.3.5; python_full_version >= '3.9.0'
backports.tarfile==1.2.0; python_version < '3.12'
black==24.4.2; python_version >= '3.8'
certifi==2024.6.2; python_version >= '3.6'
black==24.8.0; python_version >= '3.8'
certifi==2024.8.30; python_version >= '3.6'
charset-normalizer==3.3.2; python_full_version >= '3.7.0'
checksumdir==1.2.0; python_version >= '3.6' and python_version < '4.0'
click==8.1.7; python_version >= '3.7'
detect-secrets==1.5.0
dill==0.3.8; python_version >= '3.11'
dill==0.3.9; python_version >= '3.11'
docutils==0.21.2; python_version >= '3.9'
idna==3.7; python_version >= '3.5'
importlib-metadata==7.1.0; python_version >= '3.8'
idna==3.10; python_version >= '3.6'
importlib-metadata==8.5.0; python_version >= '3.8'
iniconfig==2.0.0; python_version >= '3.7'
isort==5.13.2; python_full_version >= '3.8.0'
jaraco.classes==3.4.0; python_version >= '3.8'
jaraco.context==5.3.0; python_version >= '3.8'
jaraco.functools==4.0.1; python_version >= '3.8'
keyring==25.2.1; python_version >= '3.8'
jaraco.context==6.0.1; python_version >= '3.8'
jaraco.functools==4.1.0; python_version >= '3.8'
keyring==25.4.1; python_version >= '3.8'
markdown-it-py==3.0.0; python_version >= '3.8'
mccabe==0.7.0; python_version >= '3.6'
mdurl==0.1.2; python_version >= '3.7'
more-itertools==10.2.0; python_version >= '3.8'
mypy==1.10.0; python_version >= '3.8'
more-itertools==10.5.0; python_version >= '3.8'
mypy==1.11.2; python_version >= '3.8'
mypy-extensions==1.0.0; python_version >= '3.5'
nh3==0.2.17
packaging==24.0; python_version >= '3.7'
nh3==0.2.18
packaging==24.1; python_version >= '3.8'
pathspec==0.12.1; python_version >= '3.8'
pkginfo==1.11.1; python_version >= '3.8'
platformdirs==4.2.2; python_version >= '3.8'
pkginfo==1.10.0; python_version >= '3.6'
platformdirs==4.3.6; python_version >= '3.8'
pluggy==1.5.0; python_version >= '3.8'
pygments==2.18.0; python_version >= '3.8'
pylint==3.2.3; python_full_version >= '3.8.0'
pylint==3.3.1; python_full_version >= '3.9.0'
pynt==0.8.2
pynt-contrib==0.2.0
pytest==8.2.2; python_version >= '3.8'
pyyaml==6.0.1; python_version >= '3.6'
readme-renderer==43.0; python_version >= '3.8'
pytest==8.3.3; python_version >= '3.8'
pyyaml==6.0.2; python_version >= '3.8'
readme-renderer==44.0; python_version >= '3.9'
requests==2.32.3; python_version >= '3.8'
requests-toolbelt==1.0.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
rfc3986==2.0.0; python_version >= '3.7'
rich==13.7.1; python_full_version >= '3.7.0'
tomlkit==0.12.5; python_version >= '3.7'
twine==5.1.0; python_version >= '3.8'
rich==13.9.2; python_full_version >= '3.8.0'
tomlkit==0.13.2; python_version >= '3.8'
twine==5.1.1; python_version >= '3.8'
typing-extensions==4.12.2; python_version >= '3.8'
urllib3==2.2.1; python_version >= '3.8'
vulture==2.11; python_version >= '3.8'
zipp==3.19.2; python_version >= '3.8'
urllib3==2.2.3; python_version >= '3.8'
vulture==2.13; python_version >= '3.8'
zipp==3.20.2; python_version >= '3.8'
docopt==0.6.2
pyaes==1.6.1
pyasn1==0.6.0; python_version >= '3.8'
pyasn1==0.6.1; python_version >= '3.8'
rsa==4.9; python_version >= '3.6' and python_version < '4'
telethon==1.35.0; python_version >= '3.5'
telethon==1.37.0; python_version >= '3.5'
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-i https://pypi.org/simple
docopt==0.6.2
pyaes==1.6.1
pyasn1==0.6.0; python_version >= '3.8'
pyasn1==0.6.1; python_version >= '3.8'
rsa==4.9; python_version >= '3.6' and python_version < '4'
telethon==1.35.0; python_version >= '3.5'
telethon==1.37.0; python_version >= '3.5'
12 changes: 12 additions & 0 deletions tgeraser/eraser.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,18 @@ async def _delete_messages_from_entities(self) -> None:
)

for entity in self.__entities:
if isinstance(entity, User):
print_header(
f"Deleting messages from conversation with user {get_display_name(entity)}..."
)

await self.delete_dialog(entity.id, revoke=True)

print(
f"\nDeleted all messages from conversation with user {get_display_name(entity)}.\n"
)
continue

display_name = get_display_name(entity)
print_header(f"Getting messages from '{display_name}'...")
messages_to_delete = [
Expand Down

0 comments on commit fb2f871

Please sign in to comment.