Backend¶
discord_http.backend module¶
- class discord_http.backend.DiscordHTTP(*, client: Client)[source]¶
Bases:
Quart
- error_messages(ctx: Context, e: Exception) MessageResponse | None [source]¶
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:
ctx (Context) – The context of the command
e (Exception) – The exception that was raised
- Returns:
The message response provided by the library error handler
- Return type:
Optional[MessageResponse]
- async index_ping() tuple[dict, int] | dict [source]¶
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
- run(host: str, port: int, loop: AbstractEventLoop) None [source]¶
## Do NOT use this function, use start instead