@ -74,6 +74,7 @@ __all__ = (
' MemberFlags ' ,
' ReadStateFlags ' ,
' InviteFlags ' ,
' AttachmentFlags ' ,
)
BF = TypeVar ( ' BF ' , bound = ' BaseFlags ' )
@ -2618,3 +2619,67 @@ class InviteFlags(BaseFlags):
def guest ( self ) :
""" :class:`bool`: Returns ``True`` if the invite is a guest invite. Guest invites grant temporary membership for the purposes of joining a voice channel. """
return 1 << 0
@fill_with_flags ( )
class AttachmentFlags ( BaseFlags ) :
r """ Wraps up the Discord Attachment flags
. . container : : operations
. . describe : : x == y
Checks if two AttachmentFlags are equal .
. . describe : : x != y
Checks if two AttachmentFlags are not equal .
. . describe : : x | y , x | = y
Returns a AttachmentFlags instance with all enabled flags from
both x and y .
. . describe : : x & y , x & = y
Returns a AttachmentFlags instance with only flags enabled on
both x and y .
. . describe : : x ^ y , x ^ = y
Returns a AttachmentFlags instance with only flags enabled on
only one of x or y , not on both .
. . describe : : ~ x
Returns a AttachmentFlags instance with all flags inverted from x .
. . describe : : hash ( x )
Return the flag ' s hash.
. . describe : : iter ( x )
Returns an iterator of ` ` ( name , value ) ` ` pairs . This allows it
to be , for example , constructed as a dict or a list of pairs .
Note that aliases are not shown .
. . describe : : bool ( b )
Returns whether any flag is set to ` ` True ` ` .
. . versionadded : : 2.1
Attributes
- - - - - - - - - - -
value : : class : ` int `
The raw value . You should query flags via the properties
rather than using this raw value .
"""
@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 media channel thumbnail. """
return 1 << 1
@flag_value
def remix ( self ) :
""" :class:`bool`: Returns ``True`` if the attachment has been edited using the remix feature. """
return 1 << 2