-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
src/sr/discord_bot/commands/team.py
Outdated
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)] |
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.
Hopefully shouldn't need the explicit type annotation here since it should come from the comprehension. Also mildly suggest a longer variable name:
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)] |
src/sr/discord_bot/commands/team.py
Outdated
|
||
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)] |
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.
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)] | |
] |
Shouldn't this be grouped under a disk utility category |
Co-authored-by: Alistair Lynn <[email protected]>
I don't think giving the bot a |
No description provided.