38
38
"MemberCacheFlags" ,
39
39
"ApplicationFlags" ,
40
40
"ChannelFlags" ,
41
+ "SKUFlags" ,
41
42
)
42
43
43
44
FV = TypeVar ("FV" , bound = "flag_value" )
@@ -1492,8 +1493,6 @@ def require_tag(self):
1492
1493
class AttachmentFlags (BaseFlags ):
1493
1494
r"""Wraps up the Discord Attachment flags.
1494
1495
1495
- See :class:`SystemChannelFlags`.
1496
-
1497
1496
.. container:: operations
1498
1497
1499
1498
.. describe:: x == y
@@ -1519,20 +1518,20 @@ class AttachmentFlags(BaseFlags):
1519
1518
Returns the inverse of a flag.
1520
1519
.. describe:: hash(x)
1521
1520
1522
- Return the flag's hash.
1521
+ Return the flag's hash.
1523
1522
.. describe:: iter(x)
1524
1523
1525
- Returns an iterator of ``(name, value)`` pairs. This allows it
1526
- to be, for example, constructed as a dict or a list of pairs.
1524
+ Returns an iterator of ``(name, value)`` pairs. This allows it
1525
+ to be, for example, constructed as a dict or a list of pairs.
1526
+ Note that aliases are not shown.
1527
1527
1528
1528
.. versionadded:: 2.5
1529
1529
1530
1530
Attributes
1531
1531
-----------
1532
1532
value: :class:`int`
1533
- The raw value. This value is a bit array field of a 53-bit integer
1534
- representing the currently available flags. You should query
1535
- flags via the properties rather than using this raw value.
1533
+ The raw value. You should query flags via the properties
1534
+ rather than using this raw value.
1536
1535
"""
1537
1536
1538
1537
__slots__ = ()
@@ -1551,3 +1550,66 @@ def is_thumbnail(self):
1551
1550
def is_remix (self ):
1552
1551
""":class:`bool`: Returns ``True`` if the attachment has been remixed."""
1553
1552
return 1 << 2
1553
+
1554
+
1555
+ @fill_with_flags ()
1556
+ class SKUFlags (BaseFlags ):
1557
+ r"""Wraps up the Discord SKU flags.
1558
+
1559
+ .. container:: operations
1560
+
1561
+ .. describe:: x == y
1562
+
1563
+ Checks if two SKUFlags are equal.
1564
+ .. describe:: x != y
1565
+
1566
+ Checks if two SKUFlags are not equal.
1567
+ .. describe:: x + y
1568
+
1569
+ Adds two flags together. Equivalent to ``x | y``.
1570
+ .. describe:: x - y
1571
+
1572
+ Subtracts two flags from each other.
1573
+ .. describe:: x | y
1574
+
1575
+ Returns the union of two flags. Equivalent to ``x + y``.
1576
+ .. describe:: x & y
1577
+
1578
+ Returns the intersection of two flags.
1579
+ .. describe:: ~x
1580
+
1581
+ Returns the inverse of a flag.
1582
+ .. describe:: hash(x)
1583
+
1584
+ Return the flag's hash.
1585
+ .. describe:: iter(x)
1586
+
1587
+ Returns an iterator of ``(name, value)`` pairs. This allows it
1588
+ to be, for example, constructed as a dict or a list of pairs.
1589
+ Note that aliases are not shown.
1590
+
1591
+ .. versionadded:: 2.5
1592
+
1593
+ Attributes
1594
+ -----------
1595
+ value: :class:`int`
1596
+ The raw value. You should query flags via the properties
1597
+ rather than using this raw value.
1598
+ """
1599
+
1600
+ __slots__ = ()
1601
+
1602
+ @flag_value
1603
+ def available (self ):
1604
+ """:class:`bool`: Returns ``True`` if the SKU is available for purchase."""
1605
+ return 1 << 2
1606
+
1607
+ @flag_value
1608
+ def guild_subscription (self ):
1609
+ """:class:`bool`: Returns ``True`` if the SKU is a guild subscription."""
1610
+ return 1 << 7
1611
+
1612
+ @flag_value
1613
+ def user_subscription (self ):
1614
+ """:class:`bool`: Returns ``True`` if the SKU is a user subscription."""
1615
+ return 1 << 8
0 commit comments