Response

discord_http.response module

class discord_http.response.AutocompleteResponse(choices: dict[Any, str])[source]

Bases: BaseResponse

to_dict() dict[source]

dict: Returns the response as a dict

to_multipart() bytes[source]

bytes: Returns the response as a bytes

class discord_http.response.DeferResponse(*, ephemeral: bool = False, thinking: bool = False)[source]

Bases: BaseResponse

to_dict() dict[source]

dict: Returns the response as a dict

to_multipart() bytes[source]

bytes: Returns the response as a bytes

class discord_http.response.MessageResponse(content: str | None = <MISSING>, *, file: ~discord_http.file.File | None = <MISSING>, files: list[~discord_http.file.File] | None = <MISSING>, embed: ~discord_http.embeds.Embed | None = <MISSING>, embeds: list[~discord_http.embeds.Embed] | None = <MISSING>, attachment: ~discord_http.file.File | None = <MISSING>, attachments: list[~discord_http.file.File] | None = <MISSING>, view: ~discord_http.view.View | None = <MISSING>, tts: bool | None = False, allowed_mentions: ~discord_http.mentions.AllowedMentions | None = <MISSING>, message_reference: MessageReference | None = <MISSING>, poll: Poll | None = <MISSING>, type: ~discord_http.enums.ResponseType | int = 4, ephemeral: bool | None = False)[source]

Bases: BaseResponse

to_dict(is_request: bool = False) dict[source]

The JSON data that is sent to Discord.

Parameters:

is_request (bool) – Whether the data is being sent to Discord or not.

Returns:

The JSON data that can either be sent to Discord or forwarded to a new parser

Return type:

dict

to_multipart(is_request: bool = False) bytes[source]

The multipart data that is sent to Discord.

Parameters:

is_request (bool) – Whether the data is being sent to Discord or not.

Returns:

The multipart data that can either be sent

Return type:

bytes

class discord_http.response.Ping(*, state: DiscordAPI, data: dict)[source]

Bases: Snowflake

property application: PartialUser

Returns the user object of the bot

Type:

User

property user: User

Returns the user object of the bot

Type:

User