-
Notifications
You must be signed in to change notification settings - Fork 170
Automatically unarchive channels that have been used before #143
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
Conversation
milesbxf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've added linting and formatting to the PR check - you should be able to do a pip install black isort and run ./autoformat from the root (it's worth setting up support in your editor for these).
Linting was how I caught the duplicate function issue, so definitely useful already!
response/slack/client.py
Outdated
|
|
||
| raise SlackError(f"Channel '{name}' not found") | ||
|
|
||
| def unarchive_channel(self, channel_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already an unarchive_channel function on line 143, which will override this
645f1a6 to
9e530ff
Compare
Also run black on the file.
601f0eb to
7fbacef
Compare
This handles the case of re-using an existing comms channel that may have previously been archived as we won't automatically join it on re-openning.
ca0f62d to
21cbde2
Compare
7b634a5 to
a132258
Compare
| logger.info(f"Getting channel ID for {name}") | ||
| next_cursor = None | ||
|
|
||
| while next_cursor != "": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| while next_cursor != "": | |
| while next_cursor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(empty string is False-y)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this includes a whitespace change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good (we could also clean up the next_cursor assignment using response.get(...)) but that doesn't need to be done here 👍
This is mostly for use in development. My instance tried to create comms channel #inc-101, but that channel existed already and had been archived, which the app didn't handle.