Skip to content

Commit

Permalink
Interactive mode simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Asafov committed Apr 25, 2022
1 parent 4722b8e commit 8a1f0d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_all_chats():

return [d.chat for d in dialogs]

def select_groups(self):
def select_groups(self, recursive=0):
chats = self.get_all_chats()
groups = [c for c in chats if c.type in ('group', 'supergroup')]

Expand Down Expand Up @@ -81,6 +81,9 @@ def select_groups(self):
groups_str = ', '.join(c.title for c in self.chats)
print(f'\nSelected {groups_str}.\n')

if recursive == 1:
self.run()

def run(self):
for chat in self.chats:
peer = app.resolve_peer(chat.id)
Expand Down

0 comments on commit 8a1f0d2

Please sign in to comment.