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

Do not account for jump urls for voice channels #2556

Merged

Conversation

shtlrs
Copy link
Member

@shtlrs shtlrs commented Apr 22, 2023

Closes #2555

on_voice_state_update events do not have message attributes in their context.

Which is why we'll ignore setting the jump_url for infractions triggered by these events.

channel: discord.TextChannel | discord.DMChannel | discord.Thread | discord.StageChannel
) -> bool:
"""Return True if `channel` is a voice one."""
return channel.type in [discord.ChannelType.voice, discord.ChannelType.stage_voice]
Copy link
Member Author

Choose a reason for hiding this comment

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

We might want to account for null channels that we ignore here.
In that case, I'm not sure what value to return 🤔

Copy link
Member Author

@shtlrs shtlrs Apr 22, 2023

Choose a reason for hiding this comment

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

I guess we can just let it throw, and handle those case by case if they will ever occur instead of possibly inferring the wrong type.

@shtlrs shtlrs force-pushed the 2555-empty-message-upon-superstarify branch from 10cde5d to c0773f2 Compare April 24, 2023 10:12
Copy link
Member

@mbaruh mbaruh left a comment

Choose a reason for hiding this comment

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

Untested

Copy link
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.

Looks good

@wookie184 wookie184 enabled auto-merge (squash) April 29, 2023 14:11
@wookie184 wookie184 merged commit 24e3b5a into python-discord:main Apr 29, 2023
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.

AttributeError: 'NoneType' object has no attribute 'jump_url'
3 participants