Skip to content

Conversation

@Soheab
Copy link
Contributor

@Soheab Soheab commented Jul 7, 2023

Summary

This PR adds support for attachment flags.

Depends on discord/discord-api-docs#6272

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@Soheab Soheab marked this pull request as ready for review July 14, 2023 08:45
Copy link
Owner

@Rapptz Rapptz left a comment

Choose a reason for hiding this comment

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

In the library is_ methods are always methods, i.e. callable. Since these are properties/flags you need to remove the is_ prefix.

As those are always methods.
Rapptz#9486 (review)
Copy link
Owner

@Rapptz Rapptz left a comment

Choose a reason for hiding this comment

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

Thanks.

Comment on lines +1887 to +1895
@flag_value
def clip(self):
""":class:`bool`: Returns ``True`` if the attachment is a clip."""
return 1 << 0

@flag_value
def thumbnail(self):
""":class:`bool`: Returns ``True`` if the attachment is a thumbnail."""
return 1 << 1
Copy link
Owner

Choose a reason for hiding this comment

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

I know these are undocumented on Discord's side but it sure would be nice to know what these even are for better documentation and maybe better naming, but this won't block this PR.

@Rapptz Rapptz merged commit 14faa9b into Rapptz:master Jul 15, 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.

2 participants