Skip to content

Discord Bot

Discord Bot

Discordbot refers to automated programs on Discord servers, performing tasks like moderation, music playback, user management, and community engagement. With the integration in SquadOS, your agents can send and edit messages in channels, manage members and roles, create channels and events, moderate content, trigger webhooks, and much more — all programmatically and in real time.

This tool uses OAuth 2.0 (OAUTH2) to connect.

You will need to authorize access via your Discord account. Composio manages the OAuth flow — you are redirected to Discord’s authorization screen and, once done, returned connected.

FieldRequiredDescription
N/AN/AAccess is authorized via OAuth 2.0 through Discord; there are no manual fields.
  1. Go to Tools in the side menu (/admin/tools).
  2. Open the Available tab and search for Discord Bot.
  3. Click the card to open the details and hit Connect.
  4. You’re taken to the secure connection page hosted by Composio, where you authorize access via OAuth 2.0 with your Discord account.
  5. Once done, you’re sent back to SquadOS with the account connected and the tool available to agents. (Connection-flow details in Organization Tools.)

DISCORDBOT_CREATE_MESSAGE

Sends a message to a Discord channel. Supports text content, embeds, stickers, components, and replies. Requires SEND_MESSAGES permission and at least one of content, embeds, sticker_ids, or components.

NameTypeRequiredDescription
channel_idstringYesID of the channel to send the message to.
contentstringNoMessage text content (max 2000 characters). Required if embeds, sticker_ids, and components are all empty.
embedsarrayNoUp to 10 embed objects. Each embed can contain title, description, url, timestamp, color, footer, image, thumbnail, video, provider, author, and fields.
ttsbooleanNoWhether this is a text-to-speech message.
flagsintegerNoMessage flags (e.g., 4 for SUPPRESS_EMBEDS, 64 for EPHEMERAL).
componentsarrayNoUp to 5 action rows of interactive components (buttons, select menus).
sticker_idsarrayNoUp to 3 sticker IDs accessible to the bot.
allowed_mentionsobjectNoControls which mentions in content trigger notifications.
message_referenceobjectNoReference for replying to a message. Requires message_id.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_LIST_MESSAGES

Retrieves messages from a Discord channel, ordered newest first. Supports pagination via before/after/around parameters.

NameTypeRequiredDescription
channel_idstringYesID of the Discord channel to fetch messages from.
limitintegerNoMax number of messages to return (1-100, defaults to 50).
beforestringNoGet messages before this message ID for backward pagination.
afterstringNoGet messages after this message ID for forward pagination.
aroundstringNoGet messages around this message ID.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_GET_MESSAGE

Retrieves a specific message from a Discord channel by channel and message ID.

NameTypeRequiredDescription
channel_idstringYesThe ID of the Discord channel containing the message.
message_idstringYesThe ID of the message to retrieve.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_UPDATE_MESSAGE

Edits a message previously sent by the bot. Only provide fields you want to change; use null or empty list to clear values.

NameTypeRequiredDescription
channel_idstringYesID of the channel containing the message to edit.
message_idstringYesID of the message to edit. Must be a message sent by the bot.
contentstringNoNew message content (max 2000 characters). Set to empty string to clear.
embedsarrayNoUp to 10 embed objects. Set to empty list to remove all embeds.
flagsintegerNoMessage flags to set (e.g., 4 for SUPPRESS_EMBEDS).
componentsarrayNoMessage components (buttons, select menus). Set to empty list to remove.
attachmentsarrayNoAttachments to keep or update metadata for. Omit to keep existing; empty list removes all.
allowed_mentionsobjectNoControls which mentions trigger notifications.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_DELETE_MESSAGE

Permanently deletes a message from a Discord channel. The bot can delete its own messages or, with MANAGE_MESSAGES permission, delete messages from other users.

NameTypeRequiredDescription
channel_idstringYesID of the channel containing the message to delete.
message_idstringYesID of the message to delete.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_BULK_DELETE_MESSAGES

Bulk deletes messages in a Discord channel. Requires MANAGE_MESSAGES permission. Messages must be less than 14 days old. Between 2 and 100 messages can be deleted at once.

NameTypeRequiredDescription
channel_idstringYesID of the channel from which to bulk delete messages.
messagesarrayYesList of message IDs to delete (2-100). All messages must be less than 14 days old.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_PIN_MESSAGE

Pins a message in a Discord channel. Requires MANAGE_MESSAGES permission. A channel can have at most 50 pinned messages.

NameTypeRequiredDescription
channel_idstringYesID of the channel containing the message to pin.
message_idstringYesID of the message to pin. Channel cannot exceed 50 pinned messages.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_UNPIN_MESSAGE

Unpins a message from a Discord channel. The message is not deleted, only removed from the pinned list. Requires MANAGE_MESSAGES permission.

NameTypeRequiredDescription
channel_idstringYesID of the channel containing the pinned message.
message_idstringYesID of the message to unpin.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_ADD_MY_MESSAGE_REACTION

Adds an emoji reaction from the bot to a message. Requires READ_MESSAGE_HISTORY, and ADD_REACTIONS if no one else has reacted with this emoji yet.

NameTypeRequiredDescription
channel_idstringYesID of the channel containing the message.
message_idstringYesID of the message to react to.
emojistringYesEmoji to react with. For Unicode emojis use the character directly (e.g., ’👍’). For custom emojis use ‘name:id’ format (e.g., ‘myemoji:123456789012345678’).
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_TRIGGER_TYPING_INDICATOR

Shows the bot is typing in a Discord channel. The indicator stops after 10 seconds or upon message send. Use when actively preparing a response.

NameTypeRequiredDescription
channel_idstringYesThe unique identifier of the Discord channel where the typing indicator should be displayed.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_CREATE_GUILD_CHANNEL

Creates a new Discord channel (text, voice, category, etc.) within a guild. Requires MANAGE_CHANNELS permission.

NameTypeRequiredDescription
guild_idstringYesID of the guild (server) to create the channel in.
namestringYesChannel name (1-100 characters).
typeintegerNoType of channel (0: GUILD_TEXT, 2: GUILD_VOICE, 4: GUILD_CATEGORY, 5: GUILD_ANNOUNCEMENT, 13: GUILD_STAGE_VOICE, 15: GUILD_FORUM).
topicstringNoChannel topic (0-1024 characters for text; 0-4096 for forum/media channels).
parent_idstringNoID of the parent category for this channel.
positionintegerNoSorting position of the channel.
nsfwbooleanNoWhether the channel is age-restricted.
rate_limit_per_userintegerNoSlowmode: seconds a user must wait before sending another message (0-21600).
permission_overwritesarrayNoPermission overwrite objects for the channel.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_GET_CHANNEL

Retrieves detailed metadata for a specific Discord channel by its channel_id. Returns only channel metadata, not message content or member lists.

NameTypeRequiredDescription
channel_idstringYesThe ID of the Discord channel to retrieve.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_CREATE_THREAD

Creates a new thread in a text, announcement, forum, or media channel.

NameTypeRequiredDescription
channel_idstringYesThe ID of the channel in which the new thread will be created.
namestringYesThe name of the thread (1-100 characters).
typeintegerNoThe type of thread to create. 10 for announcement, 11 for public, 12 for private.
messageobjectNoThe initial message to send in the thread. Required for forum and media channels.
auto_archive_durationintegerNoDuration in minutes to automatically archive the thread after inactivity. Values: 60, 1440, 4320, 10080.
rate_limit_per_userintegerNoSeconds a user must wait before sending another message (0-21600).
invitablebooleanNoWhether non-moderators can add other non-moderators to the thread. Only for private threads.
applied_tagsarrayNoArray of tag IDs to apply to the thread. Only for forum and media channels.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_CREATE_WEBHOOK

Creates a new webhook in a specified Discord channel, requiring MANAGE_WEBHOOKS permission.

NameTypeRequiredDescription
channel_idstringYesThe ID of the channel to create the webhook in.
namestringYesName for the webhook (1-80 characters).
avatarstringNoBase64-encoded image data URI for the webhook avatar (e.g. ‘data:image/png;base64,…’).
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_EXECUTE_WEBHOOK

Executes a Discord webhook to send messages, embeds, or interactive components to a channel or thread.

NameTypeRequiredDescription
webhook_idstringYesThe unique ID of the Discord webhook.
webhook_tokenstringYesThe secret token for the Discord webhook.
contentstringNoMessage text content (max 2000 characters).
embedsarrayNoUp to 10 embed objects for rich content.
usernamestringNoOverride the default username of the webhook (max 80 characters).
avatar_urlstringNoOverride the default avatar of the webhook with a URL to an image.
ttsbooleanNoSend as a text-to-speech message.
componentsarrayNoMessage components (buttons, select menus), up to 5 action rows.
thread_idstringNoID of a thread in the webhook’s channel to send the message to.
thread_namestringNoName of a thread to create when executing on a forum channel (max 100 characters).
waitbooleanNoIf true, waits for server confirmation and returns a message object. Defaults to true.
flagsintegerNoMessage flags bitfield (e.g. 4 for SUPPRESS_EMBEDS, 4096 for SUPPRESS_NOTIFICATIONS).
allowed_mentionsobjectNoControls which mentions in content actually ping recipients.
applied_tagsarrayNoArray of tag IDs to apply to a forum thread (only works with thread_name).
pollobjectNoA poll object to attach to the message.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_GET_GUILD

Retrieves detailed information for a specified Discord guild (server) by its guild_id, optionally including approximate member and presence counts if with_counts is true.

NameTypeRequiredDescription
guild_idstringYesThe unique identifier (snowflake ID) of the Discord guild (server) to retrieve.
with_countsbooleanNoWhen true, includes approximate member and presence counts for the guild.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_ADD_GUILD_MEMBER

Adds a user to a Discord guild using their OAuth2 access token (which must have guilds.join scope). Returns the guild member object on 201 Created, or indicates the user is already a member on 204.

NameTypeRequiredDescription
guild_idstringYesThe unique identifier (snowflake ID) of the guild to add the user to.
user_idstringYesThe unique identifier (snowflake ID) of the user to add.
access_tokenstringYesOAuth2 access token for the user, with guilds.join scope, to authorize adding them to the guild.
nickstringNoNickname to set for the user in this guild. Maximum 32 characters.
rolesarrayNoList of role IDs to assign to the user upon joining.
mutebooleanNoWhether the user should be server muted in voice channels.
deafbooleanNoWhether the user should be server deafened in voice channels.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_LIST_GUILD_MEMBERS

Retrieves a list of members for a Discord guild. Requires GUILD_MEMBERS intent. Supports pagination via limit and after parameters.

NameTypeRequiredDescription
guild_idstringYesThe unique identifier (snowflake ID) of the Discord guild (server) to retrieve members from.
limitintegerNoMax number of members to return (1-1000). Defaults to 1 if not specified.
afterstringNoUser ID for pagination offset; fetches members with IDs greater than this value.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

Search Guild Members by Username or Nickname

Section titled “Search Guild Members by Username or Nickname”

DISCORDBOT_SEARCH_GUILD_MEMBERS

Searches for members in a specific Discord guild by matching a query string against usernames and nicknames. Returns matching guild member objects.

NameTypeRequiredDescription
guild_idstringYesThe unique identifier (snowflake ID) of the Discord guild (server) to search within.
querystringYesThe query string to match against usernames or nicknames. The search is prefix-based (e.g., ‘adm’ will match ‘admin’).
limitintegerNoMaximum number of members to return (1-1000). Defaults to 1 if not specified.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_BAN_USER_FROM_GUILD

Permanently bans a user from a Discord guild, optionally deleting their recent messages.

NameTypeRequiredDescription
guild_idstringYesThe ID of the guild to ban the user from.
user_idstringYesThe ID of the user to ban.
delete_message_secondsintegerNoNumber of seconds (0-604800) of the user’s past messages to delete. Defaults to 0.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_UNBAN_USER_FROM_GUILD

Revokes a ban for a user from a Discord guild, allowing them to rejoin. Requires BAN_MEMBERS permission.

NameTypeRequiredDescription
guild_idstringYesThe ID of the guild to remove the ban from.
user_idstringYesThe ID of the user to unban.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_ADD_GUILD_MEMBER_ROLE

Assigns a role to a guild member. Requires MANAGE_ROLES permission and the role must be lower in hierarchy than the bot’s highest role. Returns 204 on success.

NameTypeRequiredDescription
guild_idstringYesThe unique identifier (snowflake ID) of the Discord guild where the member and role exist.
user_idstringYesThe unique identifier (snowflake ID) of the Discord user to whom the role will be added.
role_idstringYesThe unique identifier (snowflake ID) of the Discord role to be assigned to the member.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_CREATE_GUILD_ROLE

Creates a new role in a Discord guild with customizable name, permissions, color, hoist, mentionability, and icon. Requires MANAGE_ROLES permission. The icon and unicode_emoji fields are mutually exclusive.

NameTypeRequiredDescription
guild_idstringYesThe unique identifier (snowflake ID) of the Discord guild where the role will be created.
namestringNoName for the new role. If omitted, Discord defaults to ‘new role’.
colorintegerNoRGB color value for the role as an integer (e.g., red is 16711680). Defaults to 0 (no color).
hoistbooleanNoIf true, displays the role separately in the member list. Defaults to false.
mentionablebooleanNoIf true, this role can be mentioned by others. Defaults to false.
permissionsstringNoBitwise integer for role permissions combined from Discord permission flags.
iconstringNoHash of a custom image for the role’s icon. Mutually exclusive with unicode_emoji.
unicode_emojistringNoStandard Unicode emoji for the role’s icon. Mutually exclusive with icon.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_CREATE_CHANNEL_INVITE

Creates a new invite link for a Discord channel. Requires CREATE_INSTANT_INVITE permission.

NameTypeRequiredDescription
channel_idstringYesThe ID of the channel to create an invite for.
max_ageintegerNoDuration of invite in seconds before expiry, or 0 for never. Must be 0-604800. Defaults to 86400 (24 hours).
max_usesintegerNoMaximum number of times this invite can be used, or 0 for unlimited. Defaults to 0.
temporarybooleanNoWhether this invite only grants temporary membership. Defaults to false.
uniquebooleanNoIf true, do not reuse a similar invite. Useful for creating many unique one-time invites.
target_typeintegerNoThe type of target for this voice channel invite. 1 for Stream, 2 for Embedded Application.
target_user_idstringNoThe ID of the user whose stream to display. Required if target_type is 1.
target_application_idstringNoThe ID of the embedded application to open. Required if target_type is 2.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_CREATE_GUILD_SCHEDULED_EVENT

Creates a new scheduled event in a Discord guild. Events can be hosted in stage channels, voice channels, or external locations. STAGE_INSTANCE/VOICE require channel_id, while EXTERNAL requires entity_metadata with a location and scheduled_end_time.

NameTypeRequiredDescription
guild_idstringYesThe unique identifier (snowflake ID) of the Discord guild where the event will be created.
namestringYesThe name of the scheduled event (1-100 characters).
entity_typeintegerYesThe entity type: 1=STAGE_INSTANCE, 2=VOICE, 3=EXTERNAL.
scheduled_start_timestringYesThe time the event will start (ISO8601 timestamp, e.g., ‘2024-12-31T20:00:00’).
channel_idstringNoThe channel ID where the event will be hosted. Required for STAGE_INSTANCE and VOICE entity types. Must be null for EXTERNAL.
descriptionstringNoThe description of the scheduled event (1-1000 characters).
privacy_levelintegerNoThe privacy level of the event. Use 2 for GUILD_ONLY (only accessible to guild members).
scheduled_end_timestringNoThe time the event will end (ISO8601 timestamp). Required for EXTERNAL entity type.
entity_metadataobjectNoAdditional metadata for the guild scheduled event.
imagestringNoThe cover image as a base64 data URI (e.g., ‘data:image/png;base64,…’).
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_LEAVE_GUILD

Enables the bot to leave a specified Discord guild (server). This action is irreversible and the bot must be re-invited to rejoin.

NameTypeRequiredDescription
guild_idstringYesThe unique identifier of the Discord guild (server) the bot wishes to leave.
NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.

DISCORDBOT_TEST_AUTH

Tool to validate the configured Discord bot token by fetching the current authenticated bot user. Use when diagnosing repeated 401 errors to determine if the issue is an invalid token (this endpoint returns 401) or missing guild membership/permissions/wrong channel_id (this endpoint returns 200 but other operations fail).

NameTypeRequiredDescription
datastringYesData from the action execution.
errorstringNoError message if execution failed.
successfulbooleanYesWhether the action executed successfully.