Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions interactions/api/models/audit_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class AuditLogEvents(IntEnum):
"""
A class object representing the different types of AuditLogEvents.

.. note::
There is no official name for AuditLogEvents type 151, however it does represent the server owner sets up the guild for monetization/server subscriptions.

:ivar int GUILD_UPDATE: 1 - Server settings were updated
:ivar int CHANNEL_CREATE: 10 - Channel was created
:ivar int CHANNEL_UPDATE: 11 - Channel settings were updated
Expand Down Expand Up @@ -83,6 +86,7 @@ class AuditLogEvents(IntEnum):
:ivar int AUTO_MODERATION_BLOCK_MESSAGE: 143 - Message was blocked by AutoMod (according to a rule)
:ivar int AUTO_MODERATION_FLAG_TO_CHANNEL: 144 - Message was flagged by AutoMod (according to a rule)
:ivar int AUTO_MODERATION_USER_COMMUNICATION_DISABLED: 145 - Member was timed out by AutoMod (according to a rule)
:ivar int GUILD_MONETIZATION_SETUP: 151 - Monetization was set up in the server.
"""

# guild related
Expand Down Expand Up @@ -169,6 +173,10 @@ class AuditLogEvents(IntEnum):
AUTO_MODERATION_FLAG_TO_CHANNEL = 144
AUTO_MODERATION_USER_COMMUNICATION_DISABLED = 145

# monetization related

GUILD_MONETIZATION_SETUP = 151


@define()
class AuditLogChange(DictSerializerMixin):
Expand Down
4 changes: 4 additions & 0 deletions interactions/api/models/gw.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,14 @@ class GuildJoinRequest(DictSerializerMixin):

:ivar Snowflake user_id: The user ID of the event.
:ivar Snowflake guild_id: The guild ID of the event.
:ivar Optional[Any] request: The actual request representing the event. This pertains primarily to _CREATE, but maybe _UPDATE as well.
:ivar Optional[str] status: The status of the event, which pertains to _CREATE.
"""

user_id: Snowflake = field(converter=Snowflake)
guild_id: Snowflake = field(converter=Snowflake)
request: Optional[Any] = field(default=None)
status: Optional[str] = field(default=None)


@define()
Expand Down
8 changes: 7 additions & 1 deletion interactions/api/models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@


class MessageType(IntEnum):
"""An enumerable object representing the types of messages."""
"""
An enumerable object representing the types of messages.

.. note::
There is no official name for MessageType 25, however it does represent when someone subscribes to a server for the first time.
"""

DEFAULT = 0
RECIPIENT_ADD = 1
Expand All @@ -75,6 +80,7 @@ class MessageType(IntEnum):
GUILD_INVITE_REMINDER = 22
CONTEXT_MENU_COMMAND = 23
AUTO_MODERATION_ACTION = 24
USER_NEWLY_SUBSCRIBED = 25

@staticmethod
def not_deletable() -> List[int]:
Expand Down
11 changes: 7 additions & 4 deletions interactions/api/models/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ class RoleTags(DictSerializerMixin):
"""
A class object representing the tags of a role.

:ivar Optional[Snowflake] bot_id: The id of the bot this role belongs to
:ivar Optional[Snowflake] integration_id: The id of the integration this role belongs to
:ivar Optional[Any] premium_subscriber: Whether if this is the guild's premium subscriber role
:ivar Optional[Snowflake] bot_id?: The id of the bot this role belongs to
:ivar Optional[Snowflake] integration_id?: The id of the integration this role belongs to
:ivar Optional[Any] premium_subscriber?: Whether if this is the guild's server subscription role
:ivar Optional[Snowflake] subscription_listing_id?: The id of the linked server subscription role, if any.
:ivar Optional[bool] purchasable_or_has_subscribers?: Whether the role can be purchasable via server subscription or that the role contains subscribers, if any.
"""

bot_id: Optional[Snowflake] = field(converter=Snowflake, default=None)
integration_id: Optional[Snowflake] = field(converter=Snowflake, default=None)
premium_subscriber: Optional[Any] = field(default=None)

# TODO: Figure out what actual type it returns, all it says is null.
subscription_listing_id: Optional[Snowflake] = field(converter=Snowflake, default=None)
purchasable_or_has_subscribers: Optional[bool] = field(default=None)


@define()
Expand Down