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

Make teams mentionable #38

Merged
merged 2 commits into from
Sep 22, 2024
Merged

Make teams mentionable #38

merged 2 commits into from
Sep 22, 2024

Conversation

raccube
Copy link
Member

@raccube raccube commented Sep 22, 2024

No description provided.

@raccube raccube requested review from Adimote and prophile September 22, 2024 17:43
if guild is None:
raise app_commands.NoPrivateMessage()

team_roles: list[discord.Role] = [t for t in guild.roles if t.name.startswith(ROLE_PREFIX)]
Copy link
Member

Choose a reason for hiding this comment

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

Hopefully shouldn't need the explicit type annotation here since it should come from the comprehension. Also mildly suggest a longer variable name:

Suggested change
team_roles: list[discord.Role] = [t for t in guild.roles if t.name.startswith(ROLE_PREFIX)]
team_roles = [role for role in guild.roles if role.name.startswith(ROLE_PREFIX)]


for index, role in enumerate(team_roles):
tla = role.name.removeprefix(ROLE_PREFIX)
channels = [ch for ch in guild.channels if ch.name.startswith(TEAM_CHANNEL_PREFIX + tla)]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
channels = [ch for ch in guild.channels if ch.name.startswith(TEAM_CHANNEL_PREFIX + tla)]
channels = [
channel
for channel in guild.channels
if channel.name.startswith(TEAM_CHANNEL_PREFIX + tla)]
]

@prophile
Copy link
Member

Shouldn't this be grouped under a disk utility category

Co-authored-by: Alistair Lynn <[email protected]>
@raccube
Copy link
Member Author

raccube commented Sep 22, 2024

I don't think giving the bot a /diskutil makes the most sense...

@raccube raccube merged commit 3d05d5b into main Sep 22, 2024
3 checks passed
@raccube raccube deleted the feature/mentionable branch September 22, 2024 18:18
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.

2 participants