Integration
Represents a Discord Integration.
Attributes
bool
Whether this integration is enabled.
int
The unique identifier number of the integration.
type specific information of the integration.
str
The name of the integration.
The type of the integration.
User for who the integration is.
Properties
account
application
created_at
When the entity was created.
Returns
created_at : datetime
expire_behavior
expire_grace_period
partial
Returns whether the integration is partial.
Returns
partial : bool
revoked
role
role_id
scopes
subscriber_count
synced_at
syncing
Methods
(...)
__new__Creates a new integration from the given keyword parameters.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
integration_type |
| The integration's type. | ||
enabled |
| Whether this integration is enabled. | ||
name |
| The name of the integration. | ||
user | User for who the integration is. | |||
**keyword_parameters | Keyword parameters | keyword parameters to set the integration's attributes as. | ||
account | The integration's respective account. If the integration type is | |||
application | The application of the integration if applicable. | |||
expire_behavior | The behavior of expiring subscription. | |||
expire_grace_period |
| The grace period in days for expiring subscribers. | ||
role_id |
| The role's identifier what the integration uses for subscribers. | ||
scopes |
| The scopes the application was authorized with. | ||
subscriber_count |
| How many subscribers the integration has. | ||
synced_at |
| When the integration was last synced. | ||
syncing |
| Whether the integration syncing. |
Returns
self : instance<cls>
Raises
TypeError
- Parameter type incorrect.
- Extra or unused parameters.
ValueError
- Parameter value incorrect.
()
copyCopies the integration.
Returns
new : instance<type<self>>
(...)
copy_withCopies the integration account with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
integration_type |
| The integration's type. | ||
enabled |
| Whether this integration is enabled. | ||
name |
| The name of the integration. | ||
user | User for who the integration is. | |||
**keyword_parameters | Keyword parameters | keyword parameters to set the integration's attributes as. | ||
account | The integration's respective account. If the integration type is | |||
application | The application of the integration if applicable. | |||
expire_behavior | The behavior of expiring subscription. | |||
expire_grace_period |
| The grace period in days for expiring subscribers. | ||
role_id |
| The role's identifier what the integration uses for subscribers. | ||
scopes |
| The scopes the application was authorized with. | ||
subscriber_count |
| How many subscribers the integration has. | ||
synced_at |
| When the integration was last synced. | ||
syncing |
| Whether the integration syncing. |
Returns
self : instance<cls>
Raises
TypeError
- Parameter type incorrect.
- Extra or unused parameters.
ValueError
- Parameter value incorrect.
(data)
from_dataCreates a new integration object with the given data. If the integration already exists, then updates and returns that instead.
Parameter | Type | Description |
---|---|---|
data |
| Integration data received from Discord. |
Returns
integration : instance<cls>
(integration_id, ...)
precreateParameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
integration_id |
| The integration's identifier. | ||
integration_type |
| The integration's type. | ||
**keyword_parameters | Keyword parameters | keyword parameters to set the integration's attributes as. | ||
account | The integration's respective account. If the integration type is | |||
application | The application of the integration if applicable. | |||
enabled |
| Whether this integration is enabled. | ||
expire_behavior | The behavior of expiring subscription. | |||
expire_grace_period |
| The grace period in days for expiring subscribers. | ||
name |
| The name of the integration. | ||
role_id |
| The role's identifier what the integration uses for subscribers. | ||
scopes |
| The scopes the application was authorized with. | ||
subscriber_count |
| How many subscribers the integration has. | ||
synced_at |
| When the integration was last synced. | ||
syncing |
| Whether the integration syncing. | ||
user | User for who the integration is. |
Returns
self : instance<cls>
Raises
TypeError
- Parameter type incorrect.
- Extra or unused parameters.
ValueError
- Parameter value incorrect.
(...)
to_dataConverts the integration into a json serializable object.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
defaults |
|
| Whether default fields should be included as well. | ||
include_internals |
|
| Whether internal fields should be included as well. |
Returns
data : dict
of (str
, object
) items
(integration_id)
_create_emptyCreates a new integration with it's default attributes set.
Parameter | Type | Description |
---|---|---|
integration_id |
| The integration's identifier. |
Returns
self : instance<cls>
(integration_id, role_id)
_create_with_roleCreates a new integration with the given role
.
Parameter | Type | Description |
---|---|---|
integration_id |
| The integration's identifier. |
role_id |
| The role's identifier to create the integration with. |
Returns
self : instance<cls>
()
_get_hash_partialHashes the fields of the integration.
Returns
hash_value : int
(other)
_is_equal_same_typeReturns whether the two integrations are equal.
Helper method for .__eq__
Parameter | Type | Description |
---|---|---|
other |
| The other instance. Must be from the same type. |
Returns
is_equal : bool
(data)
_set_attributesSets the attributes of the integration from the given data
.
.id
field should be set already.
Parameter | Type | Description |
---|---|---|
data |
| Integration data received from Discord. |
()
__eq__Returns whether the two integrations are equal.
()
__ge__Whether this entity's id is greater or equal than the other's.
()
__getattr__Drops a rich attribute error.
()
__gt__Whether this entity's id is greater than the other's.
()
__hash__Returns the has value of the entity, what equals to it's id.
()
__le__Whether this entity's id is less or equal than the other's.
()
__lt__Whether this entity's id is less than the other's.
()
__ne__Returns whether the two integrations are not equal.
()
__repr__Returns the integration's representation.