Backend¶
discord_http.backend module¶
- class discord_http.backend.DiscordHTTP(*, client)¶
Bases:
ApplicationServes as the fundemental HTTP server for Discord Interactions.
We recommend to not touch this class, unless you know what you’re doing
- Parameters:
client (Client)
- error_messages(ctx, e) MessageResponse | None¶
Used to return error messages to Discord.
By default, it will only cover CheckFailed errors. You can overwrite this function to return your own error messages.
- Parameters:
- Return type:
- Returns:
The message response provided by the library error handler
- async index_ping(request) Response¶
Used to ping the interaction url, to check if it’s working.
You can overwrite this function to return your own data as well. Remember that it must return dict
- Parameters:
request (
Request) – The incoming request object (not used by default)- Return type:
Response
- jsonify(data, *, status=200) Response¶
Respond with JSON data in a standardized way using orjson.
Serves as the replacement for aiohttp’s built-in json response.
- multipart_response(body, *, status=200) Response¶
Respond with multipart data in a standardized way.