Miscellanous Models#
- enum interactions.api.models.misc.AutoModKeywordPresetTypes(value)[source]#
New in version 4.3.0.
An enumeration for the different AutoMod keyword preset types.
- Member Type:
Valid values are as follows:
- PROFANITY = <AutoModKeywordPresetTypes.PROFANITY: 1>#
- SEXUAL_CONTENT = <AutoModKeywordPresetTypes.SEXUAL_CONTENT: 2>#
- SLURS = <AutoModKeywordPresetTypes.SLURS: 3>#
- enum interactions.api.models.misc.AutoModTriggerType(value)[source]#
New in version 4.3.0.
An enumeration for the different AutoMod trigger types.
- Member Type:
Valid values are as follows:
- KEYWORD = <AutoModTriggerType.KEYWORD: 1>#
- HARMFUL_LINK = <AutoModTriggerType.HARMFUL_LINK: 2>#
- SPAM = <AutoModTriggerType.SPAM: 3>#
- KEYWORD_PRESET = <AutoModTriggerType.KEYWORD_PRESET: 4>#
- MENTION_SPAM = <AutoModTriggerType.MENTION_SPAM: 5>#
- class interactions.api.models.misc.AutoModMetaData(kwargs_dict=None, /, **other_kwargs)[source]#
New in version 4.3.0.
A class object used to represent the AutoMod Action Metadata.
Note
This is not meant to be instantiated outside the Gateway.
Note
The maximum duration for duration_seconds is 2419200 seconds, aka 4 weeks.
- enum interactions.api.models.misc.AutoModActionTypes(value)[source]#
New in version 4.3.0.
An enumeration for the different AutoMod action types.
- Member Type:
Valid values are as follows:
- BLOCK_MESSAGE = <AutoModActionTypes.BLOCK_MESSAGE: 1>#
- SEND_ALERT_MESSAGE = <AutoModActionTypes.SEND_ALERT_MESSAGE: 2>#
- TIMEOUT = <AutoModActionTypes.TIMEOUT: 3>#
- class interactions.api.models.misc.AutoModAction(kwargs_dict=None, /, **other_kwargs)[source]#
New in version 4.3.0.
A class object used for the
AUTO_MODERATION_ACTION_EXECUTION
event.Note
This is not to be confused with the GW event
AUTO_MODERATION_ACTION_EXECUTION
. This object is not the same as that dispatched object. Moreover, that dispatched object name will beAutoModerationAction
Note
The metadata can be omitted depending on the action type.
- Variables:
type (AutoModActionTypes) – Action type.
metadata (AutoModMetaData) – Additional metadata needed during execution for this specific action type.
- class interactions.api.models.misc.AutoModTriggerMetadata(kwargs_dict=None, /, **other_kwargs)[source]#
New in version 4.3.0.
A class object used to represent the trigger metadata from the AutoMod rule object.
- Variables:
keyword_filter (Optional[List[str]]) – Words to match against content.
regex_patterns (Optional[List[str]]) – Regular expression patterns to match against content.
presets (Optional[List[AutoModKeywordPresetTypes]]) – The internally pre-defined wordsets which will be searched for in content.
allow_list (Optional[List[str]]) – Substrings which will be exempt from triggering the preset trigger type.
mention_total_limit (Optional[int]) – Total number of unique role and user mentions allowed per message (Maximum of 50)
- enum interactions.api.models.misc.AllowedMentionType(value)[source]#
New in version 4.3.2.
An enumerable object representing the allowed mention types
- Member Type:
Valid values are as follows:
- EVERYONE = <AllowedMentionType.EVERYONE: 'everyone'>#
- USERS = <AllowedMentionType.USERS: 'users'>#
- ROLES = <AllowedMentionType.ROLES: 'roles'>#
- class interactions.api.models.misc.AllowedMentions(kwargs_dict=None, /, **other_kwargs)[source]#
New in version 4.3.2.
A class object representing the allowed mentions object
- Variables:
parse (Optional[List[AllowedMentionType]]) – An array of allowed mention types to parse from the content.
users (Optional[List[int]]) – An array of user ids to mention.
roles (Optional[List[int]]) – An array of role ids to mention.
replied_user (Optional[bool]) – For replies, whether to mention the author of the message being replied to.
- class interactions.api.models.misc.Snowflake(snowflake)[source]#
New in version 4.0.0.
Important
By default every ID in this library is of this class. This makes some information of them easier accessible. If you need the ID as
int
orstr
object, for example to store it in a database, just callstr(id)
orint(id)
.Changed in version 4.2.0: Added
__eq__
. You no longer have to convert this object to compare it to a string or integerThe Snowflake object.
This snowflake object will have features closely related to the API schema. In turn, compared to regular d.py’s treated snowflakes, these will be treated as strings.
(Basically, snowflakes will be treated as if they were from d.py 0.16.12)
Note
You can still provide integers to them, to ensure ease of use of transition and/or if discord API for some odd reason will switch to integer.
- property increment: int#
This is the ‘Increment’ portion of the snowflake. This is incremented for every ID generated on that process.
- Returns:
An integer denoting the increment.
- property worker_id: int#
This is the Internal Worker ID of the snowflake.
- Returns:
An integer denoting the internal worker ID.
- property process_id: int#
This is the Internal Process ID of the snowflake.
- Returns:
An integer denoting the internal process ID.
- enum interactions.api.models.misc.Color(value)[source]#
New in version 4.2.0.
Changed in version 4.4.0: Color class is now an Enum
An object representing Discord branding colors.
Note
This object only intends to cover the branding colors and no others. The main reason behind this is due to the current accepted standard of using hex codes or other custom-defined colors.
- Member Type:
Valid values are as follows:
- BLURPLE = <Color.BLURPLE: 5793266>#
- GREEN = <Color.GREEN: 5763719>#
- YELLOW = <Color.YELLOW: 16705372>#
- FUCHSIA = <Color.FUCHSIA: 15418782>#
- RED = <Color.RED: 15548997>#
- WHITE = <Color.WHITE: 16777215>#
- BLACK = <Color.BLACK: 0>#
- class interactions.api.models.misc.ClientStatus(kwargs_dict=None, /, **other_kwargs)[source]#
An object that symbolizes the status per client device per session.
- class interactions.api.models.misc.IDMixin[source]#
New in version 4.3.0.
A mixin to implement equality and hashing for models that have an id.
- class interactions.api.models.misc.Image(file, fp=<interactions.MISSING>)[source]#
New in version 4.2.0.
This class object allows you to upload Images to the Discord API.
If a fp is not given, this will try to open & send a local file at the location specified in the ‘file’ parameter.
- class interactions.api.models.misc.File(filename, fp=<interactions.MISSING>, description=<interactions.MISSING>)[source]#
New in version 4.2.0.
A File object to be sent as an attachment along with a message.
If a fp is not given, this will try to open & send a local file at the location specified in the ‘filename’ parameter.
Note
If a description is not given the file’s basename is used instead.
- class interactions.api.models.misc.Overwrite(kwargs_dict=None, /, **other_kwargs)[source]#
This is used for the PermissionOverride object.
- Variables:
id (str) – Role or User ID
type (int) – Type that corresponds ot the ID; 0 for role and 1 for member.
allow (Union[Permissions, int, str]) – Permission bit set.
deny (Union[Permissions, int, str]) – Permission bit set.