bot.http, a managed HTTP client that sits between your code and Discord’s REST API. All methods are async, so you must await them. The client handles rate-limit buckets automatically: when Discord tells it to back off, it waits and retries without raising an error in your code. Every request is sent with accurate browser-style headers so the selfbot traffic looks indistinguishable from a normal client session.
send_message
Send a message to any text channel or DM channel you have access to.int | str
required
The ID of the channel to send the message to.
str
The plaintext message body. At least one of
content, embeds, or attachments must be provided.list[dict]
A list of embed objects. Each dict maps to the Discord embed structure. Maximum of 10 embeds per message.
list[dict]
A list of message component objects (action rows, buttons, select menus). Pass an empty list
[] to explicitly send no components.dict representing the created Message object.
edit_message
Edit the content or embeds of an existing message. You can only edit messages sent by your own account.int | str
required
The channel containing the message.
int | str
required
The ID of the message to edit.
str
The new message content. Pass an empty string
"" to remove the text body (provided an embed or attachment remains).list[dict]
Replacement embed list. Omit this parameter to leave existing embeds unchanged.
dict.
delete_message / bulk_delete
Delete a single message or a batch of up to 100 messages at once.int | str
required
The channel containing the message(s).
int | str
required
(delete_message only) The ID of the message to delete.
list[int | str]
required
(bulk_delete only) A list of message IDs to delete. Must contain between 2 and 100 entries.
None on success.
fetch_message / fetch_messages
Retrieve a single message by ID, or fetch a paginated list of messages from a channel.int | str
required
The channel to fetch messages from.
int | str
required
(fetch_message only) The specific message ID to retrieve.
int
Number of messages to return. Minimum
1, maximum 100. Defaults to 50.int | str
Return messages sent before this message ID. Use for backwards pagination.
int | str
Return messages sent after this message ID. Use for forwards pagination.
int | str
Return messages surrounding this message ID. Discord returns up to
limit messages centred on the given ID. Cannot be combined with before or after.fetch_message→ a single Messagedictfetch_messages→ alist[dict]of Message objects, ordered newest-first
Only one of
before, after, or around may be specified in a single fetch_messages call.Pins
Pin or unpin a message, and retrieve all currently pinned messages in a channel.int | str
required
The channel whose pins you want to manage.
int | str
required
(pin_message / unpin_message) The message to pin or unpin.
pin_message/unpin_message→Nonefetch_pins→list[dict]of pinned Message objects
Discord limits channels to 50 pinned messages. Attempting to pin a 51st message raises a
400 Bad Request with the Maximum number of pins reached error.Reactions
Add, remove, and inspect emoji reactions on messages. Both Unicode emoji and custom server emoji are supported.int | str
required
The channel containing the target message.
int | str
required
The message to react to or inspect.
str
required
For Unicode emoji, pass the literal character (e.g.
"👍"). For custom emoji, pass "name:id" (e.g. "pepe:123456789").add_reaction/remove_reaction/clear_reactions→Nonefetch_reactions→list[dict]of partial User objects who reacted with that emoji
trigger_typing
Send a typing indicator to a channel. The indicator appears for approximately 10 seconds or until a message is sent, whichever comes first.int | str
required
The channel in which to show the typing indicator.
None
crosspost_message
Publish (crosspost) a message from an Announcement channel so it propagates to all channels that follow it.int | str
required
The ID of the Announcement channel containing the message.
int | str
required
The ID of the message to crosspost.
dict.
Crossposting only works in channels of type
5 (Guild Announcement). Calling this on a regular text channel raises a 400 Bad Request.search_messages
Search for messages within a guild using Discord’s built-in message search. Results respect the same access controls as manual searches in the client.int | str
required
The guild to search within.
str
Filter to messages containing this text.
int | str
Filter to messages sent by this user.
int | str
Restrict the search to a specific channel within the guild.
dict with a messages key containing a list[list[dict]], where each inner list is a context cluster of Message objects around a matching result.
Discord’s search index is not real-time. Very recently sent messages may not appear in results immediately.