-
Notifications
You must be signed in to change notification settings - Fork 139
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(interactions): improve fallbacks in resolved data #646
Conversation
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.
This is mostly good, although there is still a minor somewhat-bug, but I think this out of scope of this pull request.
With a command defined as
async def noguild(self, inter: disnake.CommandInteraction, channel: disnake.abc.GuildChannel) -> None:
the results of the variables are as follows:
>>> inter.channel.guild
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'PartialMessageable' object has no attribute 'guild'
>>> channel.guild
<Object id=755083284416954428>
>>> inter.guild
None
However, because inter.guild and inter.channel.guild stay consistent to what they would have been previously, there isn't really a change in behavior in this pull. The only inconsistent part is the provided channel has a guild attribute which isn't a guild attribute.
But given the current change in behavior this pull provides isn't a regression either, IMO.
@onerandomusername Good point. Should keep that in mind, as far as I can tell that would potentially be fixed by #647 |
Co-authored-by: arl <genericusername414+git@gmail.com>
Co-authored-by: arl <genericusername414+git@gmail.com>
Summary
Improves channel/guild fallbacks in resolved interaction data, also fixing typing issues.
Resolves #644.
Checklist
task lint
task pyright