Skip to content

Only output override channels & bot commands channel on whitelist error#633

Merged
ks129 merged 2 commits into
mainfrom
reduce-channels-output-in-error-embed
Mar 25, 2021
Merged

Only output override channels & bot commands channel on whitelist error#633
ks129 merged 2 commits into
mainfrom
reduce-channels-output-in-error-embed

Conversation

@ChrisLovering
Copy link
Copy Markdown
Member

Relevant Issues

Closes #556

Description

Remove all default whitelisted channels from the channel kwarg before building the output string

Reasoning

Previously this would output all channels, and could result in an error. This change ensures only the main bot channel & and any overridden channels are shown in the embed. We do this before the categories block as the categories kwarg itself is an override, so we want to include those in any output.

Screenshots

Example where there are no overrides:
image
Example where whitelist includes overrides:
image

Did you:

  • Join the Python Discord Community?
  • If dependencies have been added or updated, run pipenv lock?
  • Lint your code (pipenv run lint)?
  • Set the PR to allow edits from contributors?

Previously this would output all channels, and could result in an error.
This change ensures only the main bot channel & and any overridden channels
are shown in the embed. We do this before the categories block as
the categories kwarg itself is an override, so we want to include
those in any output.
Copy link
Copy Markdown
Contributor

@wookie184 wookie184 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me 👍 line 269 is annoying me but it's not part of this PR so that's ok

Copy link
Copy Markdown
Contributor

@Shivansh-007 Shivansh-007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👌🏻

Copy link
Copy Markdown
Contributor

@purefunctor purefunctor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ks129 ks129 merged commit c8d9153 into main Mar 25, 2021
@ks129 ks129 deleted the reduce-channels-output-in-error-embed branch March 25, 2021 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only recommend one channel in “you can’t use it here” embed

5 participants