|
|
@ -28,6 +28,13 @@ class MessageType(object): |
|
|
|
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 = 11 |
|
|
|
|
|
|
|
|
|
|
|
class MessageActivityType(object): |
|
|
|
JOIN = 1 |
|
|
|
SPECTATE = 2 |
|
|
|
LISTEN = 3 |
|
|
|
JOIN_REQUEST = 5 |
|
|
|
|
|
|
|
|
|
|
|
class Emoji(SlottedModel): |
|
|
|
""" |
|
|
|
Represents either a standard or custom Discord emoji. |
|
|
@ -85,6 +92,45 @@ class MessageReaction(SlottedModel): |
|
|
|
me = Field(bool) |
|
|
|
|
|
|
|
|
|
|
|
class MessageApplication(SlottedModel): |
|
|
|
""" |
|
|
|
The application of a Rich Presence-related chat embed. |
|
|
|
|
|
|
|
Attributes |
|
|
|
---------- |
|
|
|
id : snowflake |
|
|
|
The id of the application. |
|
|
|
cover_image : str |
|
|
|
The id of the embed's image asset. |
|
|
|
description : str |
|
|
|
The application's description. |
|
|
|
icon : str |
|
|
|
The id of the application's icon. |
|
|
|
name : str |
|
|
|
The name of the application. |
|
|
|
""" |
|
|
|
id = Field(snowflake) |
|
|
|
cover_image = Field(text) |
|
|
|
description = Field(text) |
|
|
|
icon = Field(text) |
|
|
|
name = Field(text) |
|
|
|
|
|
|
|
|
|
|
|
class MessageActivity(SlottedModel): |
|
|
|
""" |
|
|
|
The activity of a Rich Presence-related chat embed. |
|
|
|
|
|
|
|
Attributes |
|
|
|
---------- |
|
|
|
type : `MessageActivityType` |
|
|
|
The type of message activity. |
|
|
|
party_id : str |
|
|
|
The party id from a Rich Presence event. |
|
|
|
""" |
|
|
|
type = Field(enum(MessageActivityType)) |
|
|
|
party_id = int(str) |
|
|
|
|
|
|
|
|
|
|
|
class MessageEmbedFooter(SlottedModel): |
|
|
|
""" |
|
|
|
A footer for the `MessageEmbed`. |
|
|
@ -351,6 +397,10 @@ class Message(SlottedModel): |
|
|
|
Attachments for this message. |
|
|
|
reactions : list[`MessageReaction`] |
|
|
|
Reactions for this message. |
|
|
|
activity : `MessageActivity` |
|
|
|
The activity of a Rich Presence-related chat embed. |
|
|
|
application : `MessageApplication` |
|
|
|
The application of a Rich Presence-related chat embed. |
|
|
|
""" |
|
|
|
id = Field(snowflake) |
|
|
|
channel_id = Field(snowflake) |
|
|
@ -369,6 +419,8 @@ class Message(SlottedModel): |
|
|
|
embeds = ListField(MessageEmbed) |
|
|
|
attachments = AutoDictField(MessageAttachment, 'id') |
|
|
|
reactions = ListField(MessageReaction) |
|
|
|
activity = Field(MessageActivity) |
|
|
|
application = Field(MessageApplication) |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
return '<Message {} ({})>'.format(self.id, self.channel_id) |
|
|
|