Pincer Objects User#

Connection#

Connection#

class Connection#

Bases: APIObject

The connection object that the user has attached.

id#

Id of the connection account

Type

str

name#

The username of the connection account

Type

str

type#

The service of the connection (twitch, YouTube)

Type

str

verified#

Whether the connection is verified

Type

bool

friend_sync#

Whether friend sync is enabled for this connection

Type

bool

show_activity#

Whether activities related to this connection will be shown in presence updates

Type

bool

visibility#

If the connection is visible

Type

VisibilityType

revoked#

Whether the connection is revoked

Type

APINullable[bool]

integrations#

An array of partial server integrations

Type

APINullable[List[Integration]]

Integration#

IntegrationExpireBehavior#

Attributes
class IntegrationExpireBehavior#

Bases: IntEnum

Represents a Discord Integration expire behavior

REMOVE_ROLE#

Remove role on expire.

KICK#

Kick on expire.

IntegrationAccount#

Attributes
class IntegrationAccount#

Bases: APIObject

Represents a Discord Integration Account object

id#

Id of the account

Type

str

name#

Name of the account

Type

str

IntegrationApplication#

class IntegrationApplication#

Bases: APIObject

Represents a Discord Integration Application object

id#

The id of the app

Type

Snowflake

name#

The name of the app

Type

str

icon#

The icon hash of the app

Type

Optional[str]

description#

The description of the app

Type

str

summary#

The summary of the app

Type

str

bot#

The bot associated with this application

Type

APINullable[User]

Integration#

class Integration#

Bases: APIObject

Represents a Discord Integration object

id#

Integration id

Type

Snowflake

name#

Integration name

Type

str

type#

Integration type (twitch, YouTube, or discord)$

Type

str

enabled#

Is this integration enabled

Type

bool

account#

Integration account information

Type

IntegrationAccount

syncing#

Is this integration syncing

Type

APINullable[bool]

role_id#

Id that this integration uses for subscribers

Type

APINullable[Snowflake]

enable_emoticons#

Whether emoticons should be synced for this integration (twitch only currently)

Type

APINullable[bool]

expire_behavior#

The behavior of expiring subscribers

Type

APINullable[IntegrationExpireBehavior]

expire_grace_period#

The grace period (in days) before expiring subscribers

Type

APINullable[int]

user#

User for this integration

Type

APINullable[User]

synced_at#

When this integration was last synced

Type

APINullable[Timestamp]

subscriber_count#

How many subscribers this integration has

Type

APINullable[int]

revoked#

Has this integration been revoked

Type

APINullable[bool]

application#

The bot/OAuth2 application for discord integrations

Type

APINullable[IntegrationApplication]

User#

PremiumTypes#

Attributes
class PremiumTypes#

Bases: IntEnum

The type of Discord premium a user has.

NONE#

No nitro.

NITRO_CLASSIC#

Nitro classic (no boosts).

NITRO#

Full nitro subscription.

VisibilityType#

Attributes
class VisibilityType#

Bases: IntEnum

The type of connection visibility.

NONE#

Connection is not visible.

EVERYONE#

Connection is visible to everyone.

User#

class User#

Bases: APIObject

Represents a Discord user. This can be a bot account or a human account.

avatar#

The user’s avatar hash

Type

Optional[str]

discriminator#

The user’s 4-digit discord-tag

Type

str

id#

The user’s id

Type

Snowflake

username#

The user’s username, not unique across the platform

Type

str

flags#

The flags on a user’s account

Type

APINullable[int]

accent_color#

The user’s banner color encoded as an integer representation of hexadecimal color code

Type

APINullable[Optional[int]]

banner#

The user’s banner, or null if unset

Type

APINullable[Optional[str]]

banner_color#

The color of the user’s banner

Type

APINullable[Optional[Color]]

bot#

Whether the user belongs to an OAuth2 application

Type

APINullable[bool]

email#

The user’s email

Type

APINullable[Optional[str]]

locale#

The user’s chosen language option

Type

APINullable[str]

mfa_enabled#

Whether the user has two factor enabled on their account

Type

APINullable[bool]

premium_type#

The type of Nitro subscription on a user’s account

Type

APINullable[int]

public_flags#

The public flags on a user’s account

Type

APINullable[int]

system#

Whether the user is an Official Discord System user (part of the urgent message system)

Type

APINullable[bool]

verified#

Whether the email on this account has been verified

Type

APINullable[bool]

classmethod await from_id(client, user_id)#
Parameters
  • client

  • user_id

await get_avatar(size=512, ext='png')#

This function is a coroutine. Get the user’s avatar as a Pillow image.

Parameters
  • size – The size of the image to get. Defaults to 512.

  • ext – The file extension to use. Defaults to ‘png’.

Returns

The user’s avatar as a Pillow image.

Return type

class: Image

get_avatar_url(size=512, ext='png')#

Returns the url of the user’s avatar.

Parameters
  • size (int: Avatar width & height in pixels) –

  • ext (str: Image extension) –

Returns

:class:`str`

Return type

Returns the url of the user’s avatar.

await get_dm_channel()#
Returns

DM channel for this user.

Return type

Channel

property mention#

The user’s mention string.

Type

str

property premium#

The user their premium type in a usable enum.

Type

APINullable[PremiumTypes]

await send(message)#

Sends a message to a user.

Parameters

message (MessageConvertable) – Message to be sent to the user.

Voice State#

VoiceState#

class VoiceState#

Bases: APIObject, ChannelProperty, GuildProperty

Used to represent a user’s voice connection status

channel_id#

The channel id this user is connected to

Type

APINullable[Snowflake]

user_id#

The user id this voice state is for

Type

Snowflake

session_id#

The session id for this voice state

Type

str

deaf#

Whether this user is deafened by the server

Type

bool

mute#

Whether this user is muted by the server

Type

bool

self_deaf#

Whether this user is locally deafened

Type

bool

self_mute#

Whether this user is locally muted

Type

bool

self_video#

Whether this user’s camera is enabled

Type

bool

suppress#

Whether this user is muted by the current user

Type

bool

request_to_speak_timestamp#

The time at which the user requested to speak

Type

Optional[Timestamp]

guild_id#

The guild id this voice state is for

Type

APINullable[Snowflake]

member#

The guild member this voice state is for

Type

APINullable[GuildMember]

self_stream#

Whether this user is streaming using “Go Live”

Type

APINullable[bool]