Skip to content
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

Fix Issue CSSUoB#154 (Archive Single Channel) #178

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

edwinchan129
Copy link
Contributor

  • Modify autocomplete to only display channels
  • Modify archive to change permission for one channel
  • Modify archive to add archive- before channel.name to mark it as archived

Moved invite URL generation to global function within utils/generate_invite_url.py.
Deleted utils/__main__.py and utils/base_utility_function.py.
Removed main() from utils/init.py.
Moved call to generate_invite_url() to startup.py.
    - If main guild not set, invite URL will be outputted and bot will be shutdown.
    - If main guild is set, invite URL will only be outputted if CONSOLE_LOG_LEVEL in environment variable set to DEBUG.
I had to modify tests for generate_invite_url() in test/tests_util.py reflect new behavior as it no longer takes in command line arguments.
    - You may need to modify it accordingly to remove irrelevant test cases and adjust to new behavior.
- Modify autocomplete to only display channels
- Modify archive to change permission for one channel
- Modify archive to add archive- before channel.name to mark it as archived
@CarrotManMatt CarrotManMatt changed the title Fix Issue CSSUoB#154 Fix Issue CSSUoB#154 (Archive Single Channel) Apr 24, 2024
@CarrotManMatt CarrotManMatt added enhancement New feature or request good first issue Good for newcomers labels Apr 24, 2024
@CarrotManMatt CarrotManMatt linked an issue Apr 24, 2024 that may be closed by this pull request
@edwinchan129
Copy link
Contributor Author

edwinchan129 commented Apr 25, 2024

unnamed
unnamed (1)

Example of the new command on channel test-remove.

if category.permissions_for(interaction_user).is_superset(
discord.OptionChoice(name=channel.name, value=str(channel.id))
for channel
in main_guild.channels
Copy link
Member

Choose a reason for hiding this comment

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

I would reccomend using main_guild.text_channels to ensure only text channels are archived. Archiving other channel types is out of scope for this command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make /archive command archive single channel
2 participants