Pincer Objects App Section¶
Applications¶
Application¶
- class Application¶
Bases:
pincer.utils.api_object.APIObject
Represents a Discord application. (eg Bot, OAuth)
- bot_require_code_grant¶
when true the app’s bot will only join upon completion of the full oauth2 code grant flow
- Type
- summary¶
if this application is a game sold on Discord, this field will be the summary field for the store page of its primary sku
- Type
- verify_key¶
the hex encoded key for verification in interactions and the GameSDK’s GetTicket
- Type
- guild_id¶
if this application is a game sold on Discord, this field will be the guild to which it has been linked
- Type
APINullable[
Snowflake
]
- primary_sku_id¶
if this application is a game sold on Discord, this field will be the id of the “Game SKU” that is created, if exists
- Type
APINullable[
Snowflake
]
Commands¶
AppCommandType¶
- class AppCommandType¶
Bases:
enum.IntEnum
Defines the different types of application commands.
- CHAT_INPUT¶
Slash commands; a text-based command that shows up when a user types /
- USER¶
A UI-based command that shows up when you right click or tap on a user
- MESSAGE¶
A UI-based command that shows up when you right click or tap on a message
AppCommandOptionType¶
- class AppCommandOptionType¶
Bases:
enum.IntEnum
Represents a parameter type.
- SUB_COMMAND¶
The parameter will be a subcommand.
- SUB_COMMAND_GROUP¶
The parameter will be a group of subcommands.
- STRING¶
The parameter will be a string.
- INTEGER¶
The parameter will be an integer/number. (-2^53 and 2^53)
- BOOLEAN¶
The parameter will be a boolean.
- USER¶
The parameter will be a Discord user object.
- CHANNEL¶
The parameter will be a Discord channel object.
- ROLE¶
The parameter will be a Discord role object.
- MENTIONABLE¶
The parameter will be mentionable.
- NUMBER¶
The parameter will be a float. (-2^53 and 2^53)
AppCommandInteractionDataOption¶
- class AppCommandInteractionDataOption¶
Bases:
pincer.utils.api_object.APIObject
Represents a Discord Application Command Interaction Data Option
- options¶
Present if this option is a group or subcommand
- Type
APINullable[List[
AppCommandInteractionDataOption
]]
AppCommandOption¶
- class AppCommandOption¶
Bases:
pincer.utils.api_object.APIObject
Represents a Discord Application Command Option object
- type¶
The type of option
- Type
- choices¶
Choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25
- Type
APINullable[List[
AppCommandOptionChoice
]]
- options¶
If the option is a subcommand or subcommand group type, this nested options will be the parameters
- Type
APINullable[List[
AppCommandOptionChoice
]]
AppCommand¶
- defadd_option
- class AppCommand¶
Bases:
pincer.utils.api_object.APIObject
Represents a Discord Application Command object
- type¶
The type of command, defaults
1
if not set- Type
AppCommandType
- description¶
1-100 character description for
CHAT_INPUT
commands, empty string forUSER
andMESSAGE
commands- Type
- version¶
Auto-incrementing version identifier updated during substantial record changes
- Type
APINullable[
Snowflake
]
- options¶
The parameters for the command, max 25
- Type
APINullable[List[
AppCommandOption
]]
- default_permission¶
Whether the command is enabled by default when the app is added to a guild
- Type
APINullable[
bool
]
- add_option(option)¶
Add a new option field to the current application command.
- Parameters
option (
AppCommandOption
) – The option which will be appended.
ClientCommandStructure¶
Intents¶
Intents¶
- defall
- class Intents¶
Bases:
enum.IntEnum
Discord client intents.
These give your client more permissions.
Note
The given Intents must also be enabled for your client on the discord dashboard.
- NONE¶
No intents.
- GUILDS¶
Guilds intent.
- GUILD_MEMBERS¶
Members intent.
- GUILD_BANS¶
Bans intent.
- GUILD_EMOJIS_AND_STICKERS¶
Emoji and Sticker intent.
- GUILD_INTEGRATIONS¶
Integrations intent.
- GUILD_WEBHOOKS¶
Webhooks intent.
- GUILD_INVITES¶
Invites intent.
- GUILD_VOICE_STATES¶
Voice states intent.
- GUILD_PRESENCES¶
Presences intent.
- GUILD_MESSAGES¶
Message intent.
- GUILD_MESSAGE_REACTIONS¶
Reactions to messages intent.
- GUILD_MESSAGE_TYPING¶
Typing to messages intent.
- DIRECT_MESSAGES¶
DM messages intent.
- DIRECT_MESSAGE_REACTIONS¶
DM reaction to messages intent.
- DIRECT_MESSAGE_TYPING¶
DM typing to messages intent.
Interaction Base¶
CallbackType¶
- class CallbackType¶
Bases:
enum.IntEnum
The types of response a client can give to a interaction.
- PONG¶
ACK a Ping
- MESSAGE¶
Respond to an interaction with a message
- DEFERRED_MESSAGE¶
ACK an interaction and edit a response later, the user sees a loading state
- DEFERRED_UPDATE_MESSAGE¶
For components, ACK an interaction and edit the original message later
- UPDATE_MESSAGE¶
For components, edit the message the component was attached to
InteractionType¶
- class InteractionType¶
Bases:
enum.IntEnum
Represents the different types of interactions the client can have with a member.
- PING¶
Ping an interaction.
- APPLICATION_COMMAND¶
A “slash” command.
- MESSAGE_COMPONENT¶
A ui component like buttons and selects.
MessageInteraction¶
- class InteractionFlags¶
Bases:
enum.IntEnum
- EPHEMERAL¶
only the user receiving the message can see it
ResolvedData¶
- class ResolvedData¶
Bases:
pincer.utils.api_object.APIObject
Represents a Discord Resolved Data structure
- members¶
Map of Snowflakes to partial member objects
- Type
APINullable[Dict[
Snowflake
,GuildMember
]]
- messages¶
Map of Snowflakes to partial message objects
- Type
APINullable[Dict[
Snowflake
,UserMessage
]]
InteractionData¶
- class InteractionData¶
Bases:
pincer.utils.api_object.APIObject
Represents a Discord Interaction Data structure
- resolved¶
Converted users + roles + channels
- Type
APINullable[
ResolvedData
]
- options¶
The params + values from the user
- Type
APINullable[
AppCommandInteractionDataOption
]
- values¶
The values the user selected
- Type
APINullable[
SelectOption
]
Interaction¶
- asyncack
- asyncbuild
- asyncconvert
- asyncdelete
- asyncdelete_followup
- asyncedit
- asyncedit_followup
- asyncfollowup
- asyncget_followup
- asyncreply
- asyncresponse
- class Interaction¶
Bases:
pincer.utils.api_object.APIObject
Represents a Discord Interaction object
- type¶
The type of interaction
- Type
- data¶
The command data payload
- Type
APINullable[
InteractionData
]
- member¶
Guild member data for the invoking user, including permissions
- Type
APINullable[
GuildMember
]
- message¶
For components, the message they were attached to
- Type
APINullable[
UserMessage
]
- await ack(flags=None)¶
This function is a coroutine.
Acknowledge an interaction, any flags here are applied to the reply.
:param flags
InteractionFlags
: The flags which must be applied to the reply.- Raises
InteractionAlreadyAcknowledged – The interaction was already acknowledged, this can be because a reply or ack was already sent.
- await build()¶
This function is a coroutine.
Sets the parameters in the interaction that need information from the discord API.
- await convert(option)¶
This function is a coroutine.
Sets an AppCommandInteractionDataOption value parameter to the payload type
- await delete()¶
This function is a coroutine.
Delete the interaction.
- Raises
InteractionDoesNotExist – Exception raised when no reply has been sent.
- await delete_followup(message)¶
This function is a coroutine.
Remove a followup message by id.
:param message Union[
UserMessage
: The id/followup object of the followup message that must be deleted. :paramint
]: The id/followup object of the followup message that must be deleted.
- await edit(message)¶
This function is a coroutine.
Edit an interaction. This is also the way to reply to interactions whom have been acknowledged.
:param message
MessageConvertable
: The new message!- Returns
The updated message object.
- Return type
- Raises
InteractionDoesNotExist – Exception raised when no reply has been sent.
- await edit_followup(message_id, message)¶
This function is a coroutine.
Edit a followup message.
:param message_id
int
: The id of the original followup message. :param messageMessageConvertable
: The message new message.- Returns
The updated message object.
- Return type
- await followup(message)¶
This function is a coroutine.
Create a follow up message for the interaction. This allows you to respond with multiple messages.
:param message
MessageConvertable
: The message to sent.- Returns
The message that has been sent.
- Return type
- await get_followup(message_id)¶
This function is a coroutine.
Get a followup message by id.
:param message_id
int
: The id of the original followup message that must be fetched.- Returns
The fetched message object.
- Return type
- await reply(message)¶
This function is a coroutine.
Initial reply, only works if no ACK has been sent yet.
:param message
MessageConvertable
: The response message!- Raises
UseFollowup – Exception raised when a reply has already been sent so a
followup()
should be used instead.InteractionTimedOut – Exception raised when discord had to wait too long for a reply. You can extend the discord wait time by using the
ack()
function.
Session Start Limit¶
SessionStartLimit¶
- class SessionStartLimit¶
Bases:
pincer.utils.api_object.APIObject
Represents a Discord Session Start Limit object
Throttle Scope¶
ThrottleScope¶
Throttling¶
ThrottleInterface¶
DefaultThrottleHandler¶
- class DefaultThrottleHandler¶
Bases:
pincer.objects.app.throttling.ThrottleInterface
,abc.ABC
The default throttlehandler based off the
ThrottleInterface
ABC- staticmethod get_key_from_scope(ctx)¶
Retrieve the the appropriate key from the context through the throttle scope.
- Parameters
ctx (
MessageContext
) – The context to retrieve with- Returns
The throttlescope enum
- Return type
Optional[
int
]