Discord

Discord é uma poderosa plataforma de comunicação que permite conectar-se com amigos, comunidades e equipes. Ela oferece uma variedade de recursos para colaboração em equipe, incluindo canais de texto, canais de voz e videochamadas.

Com uma conta ou bot do Discord, você pode:

  • Enviar mensagens: Enviar mensagens para um canal específico
  • Obter mensagens: Obter mensagens de um canal específico
  • Obter servidor: Obter informações sobre um servidor específico
  • Obter usuário: Obter informações sobre um usuário específico

No Zoen, a integração do Discord permite que seus agentes acessem e aproveitem os servidores Discord da sua organização. Os agentes podem recuperar informações de canais do Discord, buscar usuários específicos, obter informações do servidor e enviar mensagens. Isso permite que seus fluxos de trabalho se integrem às suas comunidades no Discord, automatizem notificações e criem experiências interativas.

Importante: Para ler o conteúdo das mensagens, seu bot do Discord precisa ter o "Message Content Intent" habilitado no Discord Developer Portal. Sem essa permissão, você ainda receberá metadados da mensagem, mas o campo de conteúdo aparecerá vazio.

Os componentes do Discord no Zoen usam lazy loading eficiente, buscando dados apenas quando necessário para minimizar chamadas de API e evitar rate limiting. A renovação do token acontece automaticamente em segundo plano para manter sua conexão.

Configurando Seu Bot do Discord

  1. Acesse o Discord Developer Portal
  2. Crie uma nova aplicação e navegue até a aba "Bot"
  3. Crie um bot e copie o token do bot
  4. Em "Privileged Gateway Intents", habilite o Message Content Intent para ler o conteúdo das mensagens
  5. Convide seu bot para seus servidores com as permissões apropriadas

Usage Instructions

Comprehensive Discord integration: messages, threads, channels, roles, members, invites, and webhooks.

Actions

discord_send_message

Send a message to a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to send the message to, e.g., 123456789012345678
contentstringNoThe text content of the message
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
filesfile[]NoFiles to attach to the message

Output

ParameterTypeDescription
messagestringSuccess or error message
filesfile[]Files attached to the message
dataobjectDiscord message data
idstringMessage ID
contentstringMessage content
channel_idstringChannel ID where message was sent
authorobjectMessage author information
idstringAuthor user ID
usernamestringAuthor username
avatarstringAuthor avatar hash
botbooleanWhether author is a bot
timestampstringMessage timestamp
edited_timestampstringMessage edited timestamp
embedsarrayMessage embeds
attachmentsarrayMessage attachments
mentionsarrayUser mentions in message
mention_rolesarrayRole mentions in message
mention_everyonebooleanWhether message mentions everyone

discord_get_messages

Retrieve messages from a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to retrieve messages from, e.g., 123456789012345678
limitnumberNoMaximum number of messages to retrieve (default: 10, max: 100)

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectContainer for messages data
messagesarrayArray of Discord messages with full metadata
idstringMessage ID
contentstringMessage content
channel_idstringChannel ID
authorobjectMessage author information
idstringAuthor user ID
usernamestringAuthor username
avatarstringAuthor avatar hash
botbooleanWhether author is a bot
timestampstringMessage timestamp
edited_timestampstringMessage edited timestamp
embedsarrayMessage embeds
attachmentsarrayMessage attachments
mentionsarrayUser mentions in message
mention_rolesarrayRole mentions in message
mention_everyonebooleanWhether message mentions everyone
channel_idstringChannel ID

discord_get_server

Retrieve information about a Discord server (guild)

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectDiscord server (guild) information
idstringServer ID
namestringServer name
iconstringServer icon hash
descriptionstringServer description
owner_idstringServer owner user ID
rolesarrayServer roles
approximate_member_countnumberApproximate total member count
approximate_presence_countnumberApproximate online member count

discord_get_user

Retrieve information about a Discord user

Input

ParameterTypeRequiredDescription
botTokenstringYesDiscord bot token for authentication
userIdstringYesThe Discord user ID, e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectDiscord user information
idstringUser ID
usernamestringUsername
discriminatorstringUser discriminator (4-digit number)
avatarstringUser avatar hash
botbooleanWhether user is a bot
systembooleanWhether user is a system user
emailstringUser email (if available)
verifiedbooleanWhether user email is verified

discord_edit_message

Edit an existing message in a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID containing the message, e.g., 123456789012345678
messageIdstringYesThe ID of the message to edit, e.g., 123456789012345678
contentstringNoThe new text content for the message
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectUpdated Discord message data
idstringMessage ID
contentstringUpdated message content
channel_idstringChannel ID
edited_timestampstringMessage edited timestamp

discord_delete_message

Delete a message from a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID containing the message, e.g., 123456789012345678
messageIdstringYesThe ID of the message to delete, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_bulk_delete_messages

Delete 2-100 messages from a Discord channel in a single request

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to delete messages from, e.g., 123456789012345678
messageIdsjsonYesArray of 2-100 message IDs to delete. Messages older than 2 weeks cannot be bulk deleted.
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_add_reaction

Add a reaction emoji to a Discord message

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID containing the message, e.g., 123456789012345678
messageIdstringYesThe ID of the message to react to, e.g., 123456789012345678
emojistringYesThe emoji to react with (unicode emoji or custom emoji in name:id format)
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_remove_reaction

Remove a reaction from a Discord message

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID containing the message, e.g., 123456789012345678
messageIdstringYesThe ID of the message with the reaction, e.g., 123456789012345678
emojistringYesThe emoji to remove (unicode emoji or custom emoji in name:id format)
userIdstringNoThe user ID whose reaction to remove (omit to remove bot's own reaction), e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_pin_message

Pin a message in a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID containing the message, e.g., 123456789012345678
messageIdstringYesThe ID of the message to pin, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_unpin_message

Unpin a message in a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID containing the message, e.g., 123456789012345678
messageIdstringYesThe ID of the message to unpin, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_get_pinned_messages

Retrieve all pinned messages in a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to retrieve pinned messages from, e.g., 123456789012345678
limitnumberNoMaximum number of pins to return per page (1-50). Defaults to 50.
beforestringNoReturn pins created before this ISO8601 timestamp, for paging past the first 50 results

Output

ParameterTypeDescription
messagestringSuccess or error message
dataarrayArray of pinned Discord messages
idstringMessage ID
contentstringMessage content
channel_idstringChannel ID
timestampstringMessage timestamp
pinned_atstringWhen the message was pinned
authorobjectMessage author information
idstringAuthor user ID
usernamestringAuthor username
hasMorebooleanWhether more pinned messages exist beyond this page

discord_create_thread

Create a thread in a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to create the thread in, e.g., 123456789012345678
namestringYesThe name of the thread (1-100 characters)
messageIdstringNoThe message ID to create a thread from (if creating from existing message), e.g., 123456789012345678
autoArchiveDurationnumberNoDuration in minutes to auto-archive the thread (60, 1440, 4320, 10080)
isPublicbooleanNoWhether the standalone thread is public (visible to everyone in the channel) or private. Ignored when creating a thread from an existing message, which always inherits the parent channel visibility. Defaults to public if omitted.
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectCreated thread data
idstringThread ID
namestringThread name
typenumberThread channel type
guild_idstringServer ID
parent_idstringParent channel ID

discord_join_thread

Join a thread in Discord

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
threadIdstringYesThe thread ID to join, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_leave_thread

Leave a thread in Discord

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
threadIdstringYesThe thread ID to leave, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_archive_thread

Archive or unarchive a thread in Discord

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
threadIdstringYesThe thread ID to archive/unarchive, e.g., 123456789012345678
archivedbooleanYesWhether to archive (true) or unarchive (false) the thread
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectUpdated thread data
idstringThread ID
archivedbooleanWhether thread is archived

discord_create_channel

Create a new channel in a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
namestringYesThe name of the channel (1-100 characters)
typenumberNoChannel type (0=text, 2=voice, 4=category, 5=announcement, 13=stage)
topicstringNoChannel topic (0-1024 characters)
parentIdstringNoParent category ID for the channel, e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectCreated channel data
idstringChannel ID
namestringChannel name
typenumberChannel type
guild_idstringServer ID

discord_update_channel

Update a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to update, e.g., 123456789012345678
namestringNoThe new name for the channel
topicstringNoThe new topic for the channel
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectUpdated channel data
idstringChannel ID
namestringChannel name
typenumberChannel type
topicstringChannel topic

discord_delete_channel

Delete a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to delete, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectThe deleted channel, as returned by Discord
idstringChannel ID
namestringChannel name
typenumberChannel type
guild_idstringServer ID

discord_get_channel

Get information about a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to retrieve, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectChannel data
idstringChannel ID
namestringChannel name
typenumberChannel type
topicstringChannel topic
guild_idstringServer ID

discord_list_channels

List all channels in a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataarrayArray of Discord channels in the server
idstringChannel ID
namestringChannel name
typenumberChannel type
topicstringChannel topic
parent_idstringParent category ID
positionnumberSort position within the channel list

discord_create_role

Create a new role in a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
namestringYesThe name of the role
colornumberNoRGB color value as integer (e.g., 0xFF0000 for red)
hoistbooleanNoWhether to display role members separately from online members
mentionablebooleanNoWhether the role can be mentioned

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectCreated role data
idstringRole ID
namestringRole name
colornumberRole color
hoistbooleanWhether role is hoisted
mentionablebooleanWhether role is mentionable

discord_update_role

Update a role in a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
roleIdstringYesThe role ID to update, e.g., 123456789012345678
namestringNoThe new name for the role
colornumberNoRGB color value as integer
hoistbooleanNoWhether to display role members separately
mentionablebooleanNoWhether the role can be mentioned

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectUpdated role data
idstringRole ID
namestringRole name
colornumberRole color

discord_delete_role

Delete a role from a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
roleIdstringYesThe role ID to delete, e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_assign_role

Assign a role to a member in a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
userIdstringYesThe user ID to assign the role to, e.g., 123456789012345678
roleIdstringYesThe role ID to assign, e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_remove_role

Remove a role from a member in a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
userIdstringYesThe user ID to remove the role from, e.g., 123456789012345678
roleIdstringYesThe role ID to remove, e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_list_roles

List all roles in a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataarrayArray of Discord roles in the server
idstringRole ID
namestringRole name
colornumberRole color
hoistbooleanWhether role is hoisted
positionnumberRole position in the hierarchy
mentionablebooleanWhether role is mentionable

discord_kick_member

Kick a member from a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
userIdstringYesThe user ID to kick, e.g., 123456789012345678
reasonstringNoReason for kicking the member

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_ban_member

Ban a member from a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
userIdstringYesThe user ID to ban, e.g., 123456789012345678
reasonstringNoReason for banning the member
deleteMessageSecondsnumberNoSeconds of message history to delete, 0-604800 (7 days)

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_unban_member

Unban a member from a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
userIdstringYesThe user ID to unban, e.g., 123456789012345678
reasonstringNoReason for unbanning the member

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_get_member

Get information about a member in a Discord server

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
userIdstringYesThe user ID to retrieve, e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectMember data
userobjectUser information
idstringUser ID
usernamestringUsername
avatarstringAvatar hash
nickstringServer nickname
rolesarrayArray of role IDs
joined_atstringWhen the member joined

discord_update_member

Update a member in a Discord server (e.g., change nickname)

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678
userIdstringYesThe user ID to update, e.g., 123456789012345678
nickstringNoNew nickname for the member (null to remove)
mutebooleanNoWhether to mute the member in voice channels
deafbooleanNoWhether to deafen the member in voice channels

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectUpdated member data
nickstringServer nickname
mutebooleanVoice mute status
deafbooleanVoice deaf status

discord_create_invite

Create an invite link for a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to create an invite for, e.g., 123456789012345678
maxAgenumberNoDuration of invite in seconds (0 = never expires, default 86400)
maxUsesnumberNoMax number of uses (0 = unlimited, default 0)
temporarybooleanNoWhether invite grants temporary membership
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectCreated invite data
codestringInvite code
urlstringFull invite URL
max_agenumberMax age in seconds
max_usesnumberMax uses
temporarybooleanWhether temporary

discord_get_invite

Get information about a Discord invite

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
inviteCodestringYesThe invite code to retrieve
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectInvite data
codestringInvite code
guildobjectServer information
channelobjectChannel information
approximate_member_countnumberApproximate member count
approximate_presence_countnumberApproximate online count

discord_delete_invite

Delete a Discord invite

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
inviteCodestringYesThe invite code to delete
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

discord_create_webhook

Create a webhook in a Discord channel

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
channelIdstringYesThe Discord channel ID to create the webhook in, e.g., 123456789012345678
namestringYesName of the webhook (1-80 characters)
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectCreated webhook data
idstringWebhook ID
namestringWebhook name
tokenstringWebhook token
urlstringWebhook URL
channel_idstringChannel ID

discord_execute_webhook

Execute a Discord webhook to send a message

Input

ParameterTypeRequiredDescription
webhookIdstringYesThe webhook ID, e.g., 123456789012345678
webhookTokenstringYesThe webhook token
contentstringYesThe message content to send
usernamestringNoOverride the default username of the webhook
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectMessage sent via webhook
idstringMessage ID
contentstringMessage content
channel_idstringChannel ID
timestampstringMessage timestamp

discord_get_webhook

Get information about a Discord webhook

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
webhookIdstringYesThe webhook ID to retrieve, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message
dataobjectWebhook data
idstringWebhook ID
namestringWebhook name
channel_idstringChannel ID
guild_idstringServer ID
tokenstringWebhook token

discord_delete_webhook

Delete a Discord webhook

Input

ParameterTypeRequiredDescription
botTokenstringYesThe bot token for authentication
webhookIdstringYesThe webhook ID to delete, e.g., 123456789012345678
serverIdstringYesThe Discord server ID (guild ID), e.g., 123456789012345678

Output

ParameterTypeDescription
messagestringSuccess or error message

On this page