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

Improve typing for messages and message update methods #783

Merged
merged 2 commits into from
Sep 16, 2021

Conversation

davfsa
Copy link
Member

@davfsa davfsa commented Sep 11, 2021

Summary

Thanks to @Le0Developer for bringing up the initial issue of is_webhook always being True for MessageUpdateEvent in the Discord server.

This had me investigate and opened up a whole can of worms where I found inconsistencies and bugs in code and documentation fixes.

Changes
  • Fix the use of typing.Optional where undefined.UndefinedOr should have been used.
  • Remove trying to acquire guild_id from the cached channel on PartialMessage
    • Instead, clearly document the issue Discord imposes by not sending the guild_id
  • is_webhook can now return undefined.UNDEFINED if the information is not available
  • Fix logic in is_human to account for the changes in types
  • Set PartialMessage.member to undefined.UNDEFINED when Discord edit the message to display an embed/attachment

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

None

@davfsa davfsa added bug Something isn't working breaking This change hurts backwards compatibility labels Sep 11, 2021
@davfsa davfsa added this to the 2.0.0 milestone Sep 11, 2021
@davfsa davfsa merged commit 81e93bd into hikari-py:master Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change hurts backwards compatibility bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants