Skip to main content
Every message operation in alterself flows through 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.
Returns: A dict representing the created Message object.
Store the returned data["id"] if you need to edit or delete the message later in the same session.

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.
Returns: The updated Message object as a dict.
Discord will reject edits to messages you did not author. Attempting to edit another user’s message raises a 403 Forbidden error.

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.
Returns: None on success.
Because alterself operates as a user account, bulk_delete can only delete messages you sent yourself — it cannot be used to mass-delete other users’ messages. Pass a list of your own message IDs; any IDs belonging to other authors will be rejected by Discord.

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.
Returns:
  • fetch_message → a single Message dict
  • fetch_messages → a list[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.
Returns:
  • pin_message / unpin_message → None
  • fetch_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 — 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").
Returns:
  • add_reaction / remove_reaction / clear_reactions → None
  • fetch_reactions → list[dict] of partial User objects who reacted with that emoji
clear_reactions removes all reactions from a message and requires the Manage Messages permission.

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.
Returns: None
Call trigger_typing immediately before a send_message call to simulate a more human-like typing delay in automated workflows.

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.
Returns: The crossposted Message object as a 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.
Returns: A dict with a messages key containing a list[list[dict]] — 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.