delete_chats_of_all_exited_groups method was created in groups.py #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was no way to differentiate groups and normal chat, therefore, I was forced to scroll through entire list of contacts, where it checks for the message "You can't send messages to this group because you're no longer a participant", if message is found then it deletes the group. Now, if we allow the program to run freely without any time.sleep() it scrolls through entire list of contact without finding any match, _wait_for_presence_of_an_element was also not working so to reduce its speed I had used sleep(0.5).
There was another problem, when delete chat is successful, program losts track of which contact or group should be clicked next. So, we have to scroll from top again, But since we have already checked top few contacts, I added count variable which contains number of chats checked so far, so that it quickly scrolls through those number of chats quickly without waiting for 0.5seconds, and then continues it search again.
Constants file didn't contain any delete group button selector, so I have added GROUPS__DELETE_GROUP selector.