aboutsummaryrefslogtreecommitdiff
path: root/discord/enums.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-25 04:57:29 -0400
committerRapptz <[email protected]>2021-05-27 00:53:13 -0400
commit98570793e4af8dcfca25621e86fecd85297b0d59 (patch)
treeefcbe97935fa61126c642f00fdd3ebbc15b61375 /discord/enums.py
parentFix bug in Embed.__len__ caused by footer without text (diff)
downloaddiscord.py-98570793e4af8dcfca25621e86fecd85297b0d59.tar.xz
discord.py-98570793e4af8dcfca25621e86fecd85297b0d59.zip
Add initial support for buttons and components
Diffstat (limited to 'discord/enums.py')
-rw-r--r--discord/enums.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/discord/enums.py b/discord/enums.py
index 1fc0b29e..a06e473e 100644
--- a/discord/enums.py
+++ b/discord/enums.py
@@ -48,6 +48,8 @@ __all__ = (
'StickerType',
'InviteTarget',
'VideoQualityMode',
+ 'ComponentType',
+ 'ButtonStyle',
)
def _create_value_cls(name):
@@ -435,6 +437,15 @@ class InviteTarget(Enum):
class InteractionType(Enum):
ping = 1
application_command = 2
+ component = 3
+
+class InteractionResponseType(Enum):
+ pong = 1
+ # ack = 2 (deprecated)
+ # channel_message = 3 (deprecated)
+ channel_message = 4 # (with source)
+ deferred_channel_message = 5 # (with source)
+ ack = 6 # for components?
class VideoQualityMode(Enum):
auto = 1
@@ -443,6 +454,23 @@ class VideoQualityMode(Enum):
def __int__(self):
return self.value
+class ComponentType(Enum):
+ group = 1
+ button = 2
+
+ def __int__(self):
+ return self.value
+
+class ButtonStyle(Enum):
+ blurple = 1
+ grey = 2
+ green = 3
+ red = 4
+ hyperlink = 5
+
+ def __int__(self):
+ return self.value
+
T = TypeVar('T')
def create_unknown_value(cls: Type[T], val: Any) -> T: