Pincer Objects Events Section

Channel

ChannelPinsUpdateEvent

class ChannelPinsUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted.

channel_id

The id of the channel

Type

Snowflake

guild_id

The id of the guild

Type

APINullable[Snowflake]

last_pin_timestamp

The time at which the most recent pinned message was pinned

Type

APINullable[Timestamp]

Error

DiscordError

Attributes
class DiscordError

Bases: pincer.exceptions.PincerError, pincer.utils.api_object.APIObject

Represents an error event in the Discord Gateway.

code

The RPC error code.

Type

int

message

The error description.

Type

str

Gateway Commands

Identify

class Identify

Bases: pincer.utils.api_object.APIObject

Used to trigger the initial handshake with the gateway.

token

Authentication token

Type

str

properties

Connection properties

Type

Dict[str, str]

intents

The Gateway Intents you wish to receive

Type

Intents

compress

Whether this connection supports compression of packets

Type

APINullable[bool]

large_threshold

Value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list

Type

APINullable[int]

shard

Used for Guild Sharding

Type

APINullable[Tuple[int, int]]

presence

Presence structure for initial presence information

Type

APINullable[Any]

Resume

Attributes
class Resume

Bases: pincer.utils.api_object.APIObject

Used to replay missed events when a disconnected client resumes.

token

Session token

Type

str

session_id

Session id

Type

str

seq

Last sequence number received

Type

int

Guild

GuildBanAddEvent

Attributes
class GuildBanAddEvent

Bases: pincer.utils.api_object.APIObject

Sent when a user is banned from a guild.

guild_id

Id of the guild

Type

Snowflake

user

The banned user

Type

User

GuildBanRemoveEvent

Attributes
class GuildBanRemoveEvent

Bases: pincer.utils.api_object.APIObject

Sent when a user is unbanned from a guild.

guild_id

Id of the guild

Type

Snowflake

user

The unbanned user

Type

User

GuildEmojisUpdateEvent

Attributes
class GuildEmojisUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild’s emojis have been updated.

guild_id

Id of the guild

Type

Snowflake

emojis

Array of emojis

Type

List[Emoji]

GuildStickersUpdateEvent

Attributes
class GuildStickersUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild’s stickers have been updated.

guild_id

Id of the guild

Type

Snowflake

stickers

Array of stickers

Type

List[Sticker]

GuildIntegrationsUpdateEvent

Attributes
class GuildIntegrationsUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild integration is updated.

guild_id

Id of the guild whose integrations were updated

Type

Snowflake

GuildMemberRemoveEvent

Attributes
class GuildMemberRemoveEvent

Bases: pincer.utils.api_object.APIObject

Sent when a user is removed from a guild (leave/kick/ban).

guild_id

the id of the guild

Type

Snowflake

user

the user who was removed

Type

User

GuildMemberUpdateEvent

class GuildMemberUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild member is updated. This will also fire when the user object of a guild member changes.

guild_id

the id of the guild

Type

Snowflake

roles

user role ids

Type

List[Snowflake]

user

the user

Type

User

nick

nickname of the user in the guild

Type

APINullable[Optional[str]]

joined_at

when the user joined the guild

Type

Optional[Timestamp]

premium_since

when the user started boosting the guild

Type

APINullable[Optional[Timestamp]]

deaf

whether the user is deafened in voice channels

Type

APINullable[bool]

mute

whether the user is muted in voice channels

Type

APINullable[bool]

pending

whether the user has not yet passed the guild’s Membership Screening requirements

Type

APINullable[bool]

GuildMembersChunkEvent

class GuildMembersChunkEvent

Bases: pincer.utils.api_object.APIObject

Sent in response to Guild Request Members. You can use the chunk_index and chunk_count to calculate how many chunks are left for your request.

guild_id

The id of the guild

Type

Snowflake

members

Set of guild members

Type

List[GuildMember]

chunk_index

The chunk index in the expected chunks for this response (0 <= chunk_index < chunk_count)

Type

int

chunk_count

The total number of expected chunks for this response

Type

int

not_found

If passing an invalid id to REQUEST_GUILD_MEMBERS, it will be returned here

Type

APINullable[List[Any]]

presences

If passing true to REQUEST_GUILD_MEMBERS, presences of the returned members will be here

Type

APINullable[PresenceUpdateEvent]

nonce

The nonce used in the Guild Members Request

Type

APINullable[str]

GuildRoleCreateEvent

Attributes
class GuildRoleCreateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild role is created.

guild_id

The id of the guild

Type

Snowflake

role

The role created

Type

Role

GuildRoleUpdateEvent

Attributes
class GuildRoleUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild role is updated.

guild_id

The id of the guild

Type

Snowflake

role

The role updated

Type

Role

GuildRoleDeleteEvent

Attributes
class GuildRoleDeleteEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild role is deleted.

guild_id

Id of the guild

Type

Snowflake

role_id

Id of the role

Type

Snowflake

Hello Ready

HelloEvent

Attributes
class HelloEvent

Bases: pincer.utils.api_object.APIObject

Sent on connection to the websocket. Defines the heartbeat interval that the client should heartbeat to.

heartbeat_interval

The interval (in milliseconds) the client should heartbeat with

Type

int

ReadyEvent

class ReadyEvent

Bases: pincer.utils.api_object.APIObject

Dispatched when a client has completed the initial handshake with the gateway (for new sessions).

v

Gateway version

Type

int

user

Information about the user including email

Type

User

guilds

The guilds the user is in

Type

List[Guild]

session_id

Used for resuming connections

Type

str

application

Contains id and flags

Type

Application

shard

The shard information associated with this session, if sent when identifying

Type

APINullable[Tuple[int, int]]

integration

IntegrationDeleteEvent

class IntegrationDeleteEvent

Bases: pincer.utils.api_object.APIObject

Sent when an integration is deleted.

id

integration id

Type

Snowflake

guild_id

id of the guild

Type

Snowflake

application_id

id of the bot/OAuth2 application for this discord integration

Type

APINullable[Snowflake]

Invite

InviteCreateEvent

class InviteCreateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a new invite to a channel is created.

channel_id

The channel the invite is for

Type

Snowflake

code

The unique invite code

Type

str

created_at

The time at which the invite was created

Type

Timestamp

max_age

How long the invite is valid for (in seconds)

Type

int

max_uses

The maximum number of times the invite can be used

Type

int

temporary

Whether or not the invite is temporary (invited users will be kicked on disconnect unless they’re assigned a role)

Type

bool

guild_id

The guild of the invite

Type

APINullable[Snowflake]

inviter

The user that created the invite

Type

APIObject[User]

target_type

The type of target for this voice channel invite

Type

APINullable[InviteTargetType]

target_user

The user whose stream to display for this voice channel stream invite

Type

APINullable[User]

uses

How many times the invite has been used (always will be 0)

Type

int

InviteDeleteEvent

Attributes
class InviteDeleteEvent

Bases: pincer.utils.api_object.APIObject

Sent when an invite is deleted.

channel_id

The channel of the invite

Type

Snowflake

code

The unique invite code

Type

str

guild_id

The guild of the invite

Type

APINullable[Snowflake]

Message

MessageDeleteEvent

Attributes
class MessageDeleteEvent

Bases: pincer.utils.api_object.APIObject

Sent when a message is deleted.

id

The id of the message

Type

Snowflake

channel_id

The id of the channel

Type

Snowflake

guild_id

The id of the guild

Type

APIObject[Snowflake]

MessageDeleteBulkEvent

Attributes
class MessageDeleteBulkEvent

Bases: pincer.utils.api_object.APIObject

Sent when multiple messages are deleted at once.

ids

The ids of the messages

Type

List[Snowflake]

channel_id

The id of the channel

Type

Snowflake

guild_id

The id of the guild

Type

APIObject[Snowflake]

MessageReactionAddEvent

class MessageReactionAddEvent

Bases: pincer.utils.api_object.APIObject

Sent when a user adds a reaction to a message.

user_id

The id of the user

Type

Snowflake

channel_id

The id of the channel

Type

Snowflake

message_id

The id of the message

Type

Snowflake

emoji

The emoji used to react

Type

Emoji

guild_id

The id of the guild

Type

APINullable[Snowflake]

member

The member who reacted if this happened in a guild

Type

GuildMember

MessageReactionRemoveEvent

class MessageReactionRemoveEvent

Bases: pincer.utils.api_object.APIObject

Sent when a user removes a reaction from a message.

user_id

The id of the user

Type

Snowflake

channel_id

The id of the channel

Type

Snowflake

message_id

The id of the message

Type

Snowflake

emoji

The emoji used to react

Type

Emoji

guild_id

The id of the guild

Type

APINullable[Snowflake]

MessageReactionRemoveAllEvent

class MessageReactionRemoveAllEvent

Bases: pincer.utils.api_object.APIObject

Sent when a user explicitly removes all reactions from a message.

channel_id

The id of the channel

Type

Snowflake

message_id

The id of the message

Type

Snowflake

guild_id

The id of the guild

Type

APINullable[Snowflake]

MessageReactionRemoveEmojiEvent

class MessageReactionRemoveEmojiEvent

Bases: pincer.utils.api_object.APIObject

Sent when a bot removes all instances of a given emoji from the reactions of a message.

channel_id

The id of the channel

Type

Snowflake

message_id

The id of the message

Type

Snowflake

emoji

The emoji that was removed

Type

Emoji

guild_id

The id of the guild

Type

APINullable[Snowflake]

Presence

ActivityType

class ActivityType

Bases: enum.IntEnum

Represents the enum of the type of activity.

GAME

Playing {name}; e.g. “Playing Rocket League”

STREAMING

Streaming {details}; e.g. “Streaming Rocket League”; Only supports Twitch and YouTube.

LISTENING

Listening to {name}; e.g. “Listening to Spotify”

WATCHING

Watching {name}; e.g. “Watching YouTube Together”

CUSTOM

{emoji} {name}; e.g. “:smiley: I am cool”; Not for bots; discord limitation

COMPETING

Competing in {name}; e.g. “Competing in Arena World Champions”

ActivityTimestamp

Attributes
class ActivityTimestamp

Bases: pincer.utils.api_object.APIObject

Represents the timestamp of an activity.

start

Unix time (in milliseconds) of when the activity started

Type

APINullable[int]

end

Unix time (in milliseconds) of when the activity ends

Type

APINullable[int]

ActivityEmoji

Attributes
class ActivityEmoji

Bases: pincer.utils.api_object.APIObject

Represents an emoji in an activity.

name

The name of the emoji

Type

str

id

The id of the emoji

Type

APINullable[Snowflake]

animated

Whether this emoji is animated

Type

APINullable[bool]

ActivityParty

Attributes
class ActivityParty

Bases: pincer.utils.api_object.APIObject

Represents a party in an activity.

id

The id of the party

Type

APINullable[str]

size

Array of two integers (current_size, max_size)

Type

APINullable[Tuple[int, int]]

ActivityAssets

class ActivityAssets

Bases: pincer.utils.api_object.APIObject

Represents an asset of an activity.

large_image

the id for a large asset of the activity, usually a snowflake

Type

APINullable[str]

large_text

text displayed when hovering over the large image of the activity

Type

APINullable[str]

small_image

the id for a small asset of the activity, usually a snowflake

Type

APINullable[str]

small_text

text displayed when hovering over the small image of the activity

Type

APINullable[str]

ActivitySecrets

Attributes
class ActivitySecrets

Bases: pincer.utils.api_object.APIObject

Represents a secret of an activity.

join

The secret for joining a party

Type

APINullable[str]

spectate

The secret for spectating a game

Type

APINullable[str]

match

The secret for a specific instanced match

Type

APINullable[str]

ActivityFlags

class ActivityFlags

Bases: enum.IntEnum

An enumeration.

ActivityButton

Attributes
class ActivityButton

Bases: pincer.utils.api_object.APIObject

When received over the gateway, the buttons field is an array of strings, which are the button labels. Bots cannot access a user’s activity button URLs. When sending, the buttons field must be an array of this object.

label

The text shown on the button (1-32 characters)

Type

str

url

The url opened when clicking the button (1-512 characters)

Type

str

Activity

class Activity

Bases: pincer.utils.api_object.APIObject

Bots are only able to send name, type, and optionally url.

name

The activity’s name

Type

str

type

Activity type

Type

ActivityType

created_at

Unix timestamp (in milliseconds) of when the activity was added to the user’s session

Type

int

url

Stream url, is validated when type is 1

Type

APINullable[Optional[str]]

timestamps

Unix timestamps for start and/or end of the game

Type

APINullable[ActivityTimestamp]

application_id

Application id for the game

Type

APINullable[Snowflake]

details

What the player is currently doing

Type

APINullable[Optional[str]]

state

The user’s current party status

Type

APINullable[Optional[str]]

emoji

The emoji used for a custom status

Type

APINullable[Optional[ActivityEmoji]]

party

Information for the current party of the player

Type

APINullable[ActivityParty]

assets

Images for the presence and their hover texts

Type

APINullable[ActivityAssets]

secrets

Secrets for Rich Presence joining and spectating

Type

APINullable[ActivitySecrets]

instance

“nether or not the activity is an instanced game session

Type

APINullable[bool]

flags

Activity flags ORd together, describes what the payload includes

Type

APINullable[ActivityFlags]

buttons

The url button on an activity.

Type

APINullable[List[ActivityButton]]

ClientStatus

Attributes
class ClientStatus

Bases: pincer.utils.api_object.APIObject

Active sessions are indicated with an “online”, “idle”, or “dnd” string per platform. If a user is offline or invisible, the corresponding field is not present.

desktop

The user’s status set for an active desktop (Windows, Linux, Mac) application session

Type

APINullable[str]

mobile

The user’s status set for an active mobile (iOS, Android) application session

Type

APINullable[str]

web

The user’s status set for an active web (browser, bot account) application session

Type

APINullable[str]

PresenceUpdateEvent

class PresenceUpdateEvent

Bases: pincer.utils.api_object.APIObject

This event is sent when a user’s presence or info, such as name or avatar, is updated.

user

The user presence is being updated for

Type

User

guild_id

Id of the guild

Type

Snowflake

status

Either “idle”, “dnd”, “online”, or “offline”

Type

str

activities

User’s current activities

Type

List[Activity]

client_status

User’s platform-dependent status

Type

ClientStatus

Thread

ThreadListSyncEvent

class ThreadListSyncEvent

Bases: pincer.utils.api_object.APIObject

Sent when the current user gains access to a channel.

guild_id

The id of the guild

Type

Snowflake

threads

All active threads in the given channels that the current user can access

Type

List[Channel]

members

All thread member objects from the synced threads for the current user, indicating which threads the current user has been added to

Type

List[ThreadMember]

channel_ids

The parent channel ids whose threads are being synced. If omitted, then threads were synced for the entire guild. This array may contain channel_ids that have no active threads as well, so you know to clear that data.

Type

APINullable[List[Snowflake]]

ThreadMembersUpdateEvent

class ThreadMembersUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when anyone is added to or removed from a thread. If the current user does not have the GUILD_MEMBERS Gateway Intent, then this event will only be sent if the current user was added to or removed from the thread.

id

The id of the thread

Type

Snowflake

guild_id

The id of the guild

Type

Snowflake

member_count

The approximate number of members in the thread, capped at 50

Type

int

added_members

The users who were added to the thread

Type

APINullable[List[ThreadMember]]

removed_member_ids

The id of the users who were removed from the thread

Type

APINullable[List[Snowflake]]

Typing Start

TypingStartEvent

class TypingStartEvent

Bases: pincer.utils.api_object.APIObject

Sent when a user starts typing in a channel.

channel_id

Id of the channel

Type

Snowflake

user_id

Id of the user

Type

Snowflake

timestamp

Unix time (in seconds) of when the user started typing

Type

int

guild_id

Id of the guild

Type

APINullable[Snowflake]

member

The member who started typing if this happened in a guild

Type

APINullable[GuildMember]

Voice

VoiceServerUpdateEvent

Attributes
class VoiceServerUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild’s voice server is updated. This is sent when initially connecting to voice, and when the current voice instance fails over to a new server.

token

Voice connection token

Type

str

guild_id

The guild this voice server update is for

Type

Snowflake

endpoint

The voice server host

Type

Optional[str]

Webhook

WebhooksUpdateEvent

Attributes
class WebhooksUpdateEvent

Bases: pincer.utils.api_object.APIObject

Sent when a guild’s channel webhook is created, updated, or deleted.

guild_id

id of the guild

Type

Snowflake

channel_id

id of the channel

Type

Snowflake