Lodol Docs

Discord

API actions for the Discord integration.

Discord

Send messages and moderate communities using your Discord bot. After adding your bot token, invite the bot to each server with the right permissions so actions can run.


Count members in a voice channel.

Counts how many members are currently connected to a given voice channel in a server.

Parameters

ParameterTypeRequiredDescription
guild_idstringYesThe Discord server ID.
channel_idstringYesThe Discord voice channel ID.

Response

5

Count recent messages in a Discord channel.

Counts how many messages were sent in a specific channel over the past number of days you choose.

Parameters

ParameterTypeRequiredDescription
channel_idstringYesThe Discord channel ID.
daysnumberYesHow many days back to count, as a whole number (0 or higher). Use 0 to count messages from today only.

Response

42

Count recent messages in a Discord server.

Counts how many messages were sent across a Discord server over the past number of days you choose.

Parameters

ParameterTypeRequiredDescription
guild_idstringYesThe Discord server ID.
daysnumberYesHow many days back to count, as a whole number (0 or higher). Use 0 to count messages from today only.

Response

1250

Create a text channel in a Discord server.

Creates a new text channel in the specified Discord server with an optional topic and parent category.

Parameters

ParameterTypeRequiredDescription
guild_idstringYesThe ID of the Discord server where the channel will be created.
namestringYesThe name of the new channel.
topicstringNoThe topic/description of the channel.
parent_idstringNoThe ID of the category to place the channel under.

Response

{
  "id": "1234567890123456789",
  "name": "new-channel",
  "type": 0
}

Get channels in a Discord server.

Retrieves the list of channels in the specified Discord server.

Parameters

ParameterTypeRequiredDescription
guild_idstringYesThe Discord server ID (e.g., 987654321098765432).

Response

[
  {
    "id": "1234567890123456789",
    "name": "general",
    "type": 0
  },
  {
    "id": "1234567890123456790",
    "name": "voice-chat",
    "type": 2
  }
]

List my Discord server IDs.

Returns a list of IDs for the Discord servers you or your bot belong to.

Response

[
  "1234567890123456789",
  "9876543210987654321"
]

Send a message to a Discord channel.

Sends a text message to the specified Discord channel. The message can optionally be read aloud (text-to-speech) or include rich embeds.

Parameters

ParameterTypeRequiredDescription
channel_idstringYesThe Discord channel ID to send the message to (e.g., 123456789012345678).
contentstringYesThe message content (text) to send.
ttsbooleanNoSet to true to have Discord read the message aloud (text-to-speech).
embedsarrayNoA list of rich embeds to include with the message. Each embed can have a title, description, color, and fields.

Response

{
  "channel_id": "9876543210987654321",
  "content": "Hello, Discord!",
  "id": "1234567890123456789"
}

On this page