Connection
A connection object that a user is attached to.
Attributes
bool
Whether the user has friend sync enabled for the connection.
int
The unique identifier value of the connection.
A guild's integrations which are attached to the connection.
For who is the connection metadata visible for.
str
The username of the connected account.
bool
Whether the connection is revoked.
bool
Whether activity related to this connection will be shown in presence updates.
bool
Whether this connection has a corresponding third party OAuth2 token.
The service of the connection.
bool
Whether the connection is verified.
For who is the connection visible for.
Properties
created_at
When the entity was created.
Returns
created_at : datetime
Methods
(...)
__new__Creates a new connection from the given parameters.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
connection_type |
| The service of the connection. | ||
friend_sync |
| Whether the user has friend sync enabled for the connection. | ||
integrations |
| A guild's integrations which are attached to the connection. | ||
metadata_visibility |
| For who is the connection metadata visible for. | ||
name |
| The username of the connected account. | ||
revoked |
| Whether the connection is revoked. | ||
show_activity |
| Whether activity related to this connection will be shown in presence updates. | ||
two_way_link |
| Whether this connection has a corresponding third party OAuth2 token. | ||
verified |
| Whether the connection is verified. | ||
visibility |
| For who is the connection visible for. |
Raises
TypeError
- If a field's type is unacceptable.
ValueError
- If a a field's value is unacceptable.
()
copyCopies the connection returning a new partial one.
Returns
new : instance<cls>
(...)
copy_withCopies the connection with the given fields returning a new partial one.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
connection_type |
| The service of the connection. | ||
friend_sync |
| Whether the user has friend sync enabled for the connection. | ||
integrations |
| A guild's integrations which are attached to the connection. | ||
metadata_visibility |
| For who is the connection metadata visible for. | ||
name |
| The username of the connected account. | ||
revoked |
| Whether the connection is revoked. | ||
show_activity |
| Whether activity related to this connection will be shown in presence updates. | ||
two_way_link |
| Whether this connection has a corresponding third party OAuth2 token. | ||
verified |
| Whether the connection is verified. | ||
visibility |
| For who is the connection visible for. |
Returns
new : instance<cls>
Raises
TypeError
- If a field's type is unacceptable.
ValueError
- If a a field's value is unacceptable.
(data)
from_dataCreates a connection object from received connection data.
Parameter | Type | Description |
---|---|---|
data |
| Received connection data. |
()
iter_integrationsIterates over the integrations of the connection.
This method is an iterable generator.
Yields
integration : Integration
(connection_id, ...)
precreateCreates a new connection with the given predefined fields.
Since connections are not cached globally, this method is only be used for testing.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
connection_id |
| The connection's identifier. | ||
**keyword_parameters | Keyword Parameters | The attributes to set. | ||
connection_type |
| The service of the connection. | ||
friend_sync |
| Whether the user has friend sync enabled for the connection. | ||
integrations |
| A guild's integrations which are attached to the connection. | ||
metadata_visibility |
| For who is the connection metadata visible for. | ||
name |
| The username of the connected account. | ||
revoked |
| Whether the connection is revoked. | ||
show_activity |
| Whether activity related to this connection will be shown in presence updates. | ||
two_way_link |
| Whether this connection has a corresponding third party OAuth2 token. | ||
verified |
| Whether the connection is verified. | ||
visibility |
| For who is the connection visible for. |
Returns
self : instance<cls>
Raises
TypeError
- If
connection_id
is notint
. - If a field's type is unacceptable.
- Extra or unused parameters
ValueError
- If a a field's value is unacceptable.
(...)
to_dataConverts the connection to json serializable representation dictionary.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
defaults |
|
| Whether default values should be included as well. | ||
include_internals |
|
| Whether we want to include identifiers as well. |
Returns
data : dict
of (str
, str
) items
(connection_id)
_create_emptyCreates a new connection with it's default attributes set.
Parameter | Type | Description |
---|---|---|
connection_id |
| The connection's identifier. |
Returns
self : instance<cls>
()
_get_hash_partialReturns a partial connection's hash value.
Returns
hash_value : int
(other)
_is_equal_same_typeHelper method for .__eq__
Parameter | Type | Description |
---|---|---|
other |
| The other instance. Must be from the same type. |
Returns
is_equal : bool
()
__eq__Returns whether the two connections 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 connection's hash.
()
__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 connections are equal.
()
__repr__Returns the connection's representation.