Use Discord with AI Agents

An instant messaging and VoIP social platform.
🔗 Connect and Use Discord
1. 🔑 Connect your Discord account
2. ✅ Select an action
3. 🚀 Go live with the agent
What do you want to do?
Actions
- Get my oauth2 application

API actions for Discord for AI assitants/agents

Language
JS
PYTHON

Get My Oauth2 Application

The endpoint fetches details of the user's OAuth2 app, such as ID, name, and bot info, also providing application features or client error messages.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_MY_OAUTH2_APPLICATION])

Getmyoauth2application

The endpoint fetches details of the user's OAuth2 app, such as ID, name, and bot info, also providing application features or client error messages.<<DEPRECATED use get_my_oauth2_application>>
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GETMYOAUTH2APPLICATION])

List My Connections

This endpoint fetches a user's connections list, covering integrations and friend sync settings. It shows details for types like Facebook, GitHub, and Spotify, including activity, visibility,
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_MY_CONNECTIONS])

Listmyconnections

This endpoint fetches a user's connections list, covering integrations and friend sync settings. It shows details for types like Facebook, GitHub, and Spotify, including activity, visibility,
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LISTMYCONNECTIONS])

Create Dm

Creates a direct message channel or group DM, requiring recipient ID(s) and optionally access tokens and nicknames for group DMs. Returns channel details including type and recipients on succe
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_CREATE_DM])

List My Guilds

This endpoint fetches the current user's guilds with pagination options ('before', 'after', 'limit') and an option for member counts, returning guilds' IDs, names, and features, including erro
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_MY_GUILDS])

Listmyguilds

This endpoint fetches the current user's guilds with pagination options ('before', 'after', 'limit') and an option for member counts, returning guilds' IDs, names, and features, including erro
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LISTMYGUILDS])

Get My Application

This endpoint retrieves the application details of the current user. It returns an application object including id, name, icon, and more, for successful requests, and an error object for clien
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_MY_APPLICATION])

Getmyapplication

This endpoint retrieves the application details of the current user. It returns an application object including id, name, icon, and more, for successful requests, and an error object for clien
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GETMYAPPLICATION])

Update My Application

The `/applications/@me` PATCH endpoint allows users to update their application details like description, icon, and more, using JSON. Successful updates return a 200 status, while failures pro
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_UPDATE_MY_APPLICATION])

Get Bot Gateway

This endpoint retrieves the bot's gateway URL and session start limits, including shard count, max concurrency, and reset intervals. Errors return as client-related issues with detailed descri
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_BOT_GATEWAY])

Get Public Keys

This endpoint retrieves public keys for OAuth2, responding with keys in JSON including properties like 'kty', 'use', 'kid', 'n', 'e', 'alg'. Handles client errors with detailed error messages.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_PUBLIC_KEYS])

Getpublickeys

This endpoint retrieves public keys for OAuth2, responding with keys in JSON including properties like 'kty', 'use', 'kid', 'n', 'e', 'alg'. Handles client errors with detailed error messages.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GETPUBLICKEYS])

Get My Oauth2 Authorization

The `/oauth2/@me` endpoint fetches current OAuth2 auth info, including application, user details, and granted scopes in JSON. It handles errors structuredly and ensures security with BotToken
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_MY_OAUTH2_AUTHORIZATION])

Getmyoauth2authorization

The `/oauth2/@me` endpoint fetches current OAuth2 auth info, including application, user details, and granted scopes in JSON. It handles errors structuredly and ensures security with BotToken
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GETMYOAUTH2AUTHORIZATION])

List Voice Regions

This GET endpoint at `/voice/regions` lists voice regions, including details like `id`, `name`, and flags for `custom`, `deprecated`, and `optimal` statuses. It supports 200 responses with an
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_VOICE_REGIONS])

Get My User

The "/users/@me" endpoint supports GET requests to fetch user details like ID, username, and avatar, among others, accommodating various locales and premium types. It offers detailed responses
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_MY_USER])

Getmyuser

The "/users/@me" endpoint supports GET requests to fetch user details like ID, username, and avatar, among others, accommodating various locales and premium types. It offers detailed responses
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GETMYUSER])

Update My User

Update the current user's profile, including username and avatar. Request must include a username (2-32 chars) and an optional avatar in base64 encoding. Returns updated user details on succes
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_UPDATE_MY_USER])

Create Stage Instance

Create a stage instance on Discord. Accepts a topic, channel ID, optional privacy level, guild scheduled event ID, and notification flag. Returns guild ID, topic, privacy level, and instance I
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_CREATE_STAGE_INSTANCE])

List Sticker Packs

This endpoint retrieves a list of sticker packs, detailing each pack's ID, SKU, name, description, and associated stickers, including sticker IDs, names, tags, types, format, and sort values.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_STICKER_PACKS])

Get Gateway

The GET endpoint '/gateway' fetches the connection URL via a 200 response JSON with 'url', and details client errors (4XX) with error codes and messages. It supports optional BotToken authenti
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_GATEWAY])

Create Guild

Create a guild in Discord. Allows specifying guild details like name, icon, verification level, role permissions, and channels. Requires a guild name; other fields optional. Success response i
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_CREATE_GUILD])

Createguild

Create a guild in Discord. Allows specifying guild details like name, icon, verification level, role permissions, and channels. Requires a guild name; other fields optional. Success response i
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_CREATEGUILD])

List My Private Archived Threads

This endpoint retrieves archived private threads in a channel, searchable by date or quantity (2-100), returning thread details and metadata, with error handling for client issues.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_MY_PRIVATE_ARCHIVED_THREADS])

List Guild Application Command Permissions

This endpoint fetches command permissions for an application in a guild, detailing permissions by ID with support for role, user, and channel specifics, and returns errors with Discord's codes
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_GUILD_APPLICATION_COMMAND_PERMISSIONS])

Get Guild Application Command Permissions

This endpoint fetches a command's permissions in a guild by application_id, guild_id, and command_id, returning command permissions data and IDs, along with a permissions array. Errors return
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_GUILD_APPLICATION_COMMAND_PERMISSIONS])

Set Guild Application Command Permissions

Update guild application command permissions with a `PUT` request for up to 100 items, specifying `id`, `type`, and `permission`. Successful updates return command details and permissions; err
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_SET_GUILD_APPLICATION_COMMAND_PERMISSIONS])

Add My Message Reaction

This endpoint lets users add emoji reactions to messages in a channel. Success returns a 204 code; failures return an errors object with details specific to Discord API.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_ADD_MY_MESSAGE_REACTION])

Delete My Message Reaction

This API endpoint lets users remove a specified reaction from a message in a channel. Successful deletions return a 204 code; client errors result in 4XX codes with a detailed error object.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_DELETE_MY_MESSAGE_REACTION])

List Private Archived Threads

This endpoint retrieves archived private threads in a channel, allowing filters by 'before' date and 'limit' (2-100). It returns details like thread ID, type, message count, and member info. E
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_PRIVATE_ARCHIVED_THREADS])

List Public Archived Threads

This endpoint fetches archived public threads from a channel, allowing optional filters by 'before' timestamp and result limits. Successful responses include thread ID, type, and message count
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_PUBLIC_ARCHIVED_THREADS])

Get Application User Role Connection

The endpoint fetches user role connection details (platform, username, metadata) using a GET request and OAuth2 ('role_connections.write' scope). It covers successful and error responses relat
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_APPLICATION_USER_ROLE_CONNECTION])

Update Application User Role Connection

Update a user's app role by specifying platform name (50 chars max) and username (100 chars max), with optional metadata. Includes success and error response handling.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_UPDATE_APPLICATION_USER_ROLE_CONNECTION])

Get My Guild Member

Fetches a user's guild membership details like avatar, status, join date, roles, and more, requiring `guilds.members.read` permission. Returns errors for client issues.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_MY_GUILD_MEMBER])

Get Application Role Connections Metadata

This endpoint fetches metadata for app role connections using application ID, supporting integer/datetime comparisons and security via BotToken. It returns metadata arrays or null, with error
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_APPLICATION_ROLE_CONNECTIONS_METADATA])

Get Guild Application Command

This endpoint fetches a guild's specific application command, needing application, guild, and command IDs. Returns command details if successful or a Discord error object otherwise. Access req
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_GET_GUILD_APPLICATION_COMMAND])

Delete Guild Application Command

This endpoint deletes a specific command for a guild application by ID. On success, returns a 204 response. Client errors are detailed with Discord API error objects including codes and messag
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_DELETE_GUILD_APPLICATION_COMMAND])

Update Guild Application Command

This API endpoint allows updating guild application commands using application, guild, and command IDs. It modifies details, options, permissions, and channels with authentication, returning s
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_UPDATE_GUILD_APPLICATION_COMMAND])

List Guild Application Commands

This endpoint fetches Discord guild-specific commands, detailing IDs, names, descriptions, and supports localization. It includes text/UI commands, permissions, input types, secures access via
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_GUILD_APPLICATION_COMMANDS])

Create Guild Application Command

This endpoint facilitates new guild application commands creation, allowing customization of options, permissions, and localization. It returns command details and specifies errors for client
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_CREATE_GUILD_APPLICATION_COMMAND])

Join Thread

This endpoint lets users join a channel thread with PUT, returning a 204 on success and errors with codes and messages for client issues. Authentication requires a BotToken.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_JOIN_THREAD])

Leave Thread

This endpoint allows a user to leave a thread in a channel by their ID. Upon success, it returns a 204 code without content. For client errors, it provides a detailed error object including a
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LEAVE_THREAD])

Bulk Delete Messages

This endpoint enables bulk deletion of 2-100 messages in a Discord channel via message ID list. It returns a 204 on success and client error responses for failures. Bot token authentication is
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_BULK_DELETE_MESSAGES])

Delete User Message Reaction

Endpoint allows deleting a user's reaction (specified by emoji_name and user_id) to a message in a channel. It returns a 204 on success or a client error with a detailed message and error code
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_DELETE_USER_MESSAGE_REACTION])

List Message Reactions By Emoji

Get reactions by emoji on a specific message in a channel, providing pagination options `after` (snowflake) and `limit` (1-100). Responds with an array of user objects who reacted with the spe
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_LIST_MESSAGE_REACTIONS_BY_EMOJI])

Delete All Message Reactions By Emoji

This endpoint allows the deletion of all reactions for a specific emoji on a message in a channel. Responses include a 204 on success or client errors with detailed messages.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_DELETE_ALL_MESSAGE_REACTIONS_BY_EMOJI])

Delete All Message Reactions

This endpoint deletes all reactions for a specified message, returning a 204 on success and providing error details in JSON format. Security is handled through BotToken.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_DELETE_ALL_MESSAGE_REACTIONS])

Crosspost Message

The `/channels/{channel_id}/messages/{message_id}/crosspost` API endpoint enables message crossposting in channels, returning a 200 status and message details upon success or a 4XX error for c
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_CROSSPOST_MESSAGE])

Create Thread From Message

Create threads from a message in a channel by specifying a name and optional parameters like auto-archive duration and rate limit per user. Returns details of the created thread, including its
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.DISCORD_CREATE_THREAD_FROM_MESSAGE])

Frequently asked questions

What is Composio.dev?

Composio.dev is a platform for building AI applications, designed to make the process of developing AI solutions super easy and fun! It provides a comprehensive set of tools and libraries that simplify the process of developing AI solutions, allowing you to focus on the creative aspects of your project without getting bogged down by the technical details.

How does Composio.dev support Discord?

Composio.dev seamlessly integrates with Discord, allowing you to leverage its capabilities within the Composio.dev platform. You can utilize Discord to call functions across various platforms, including Google, GitHub, and others, making it a breeze to incorporate different services into your AI applications. Additionally, it supports user authentication via OAuth2 and can work in conjunction with other popular frameworks like LangChain and CrewAI, giving you the flexibility to build truly innovative AI solutions.

What models can I use with Discord?

With Discord, you have access to a wide range of state-of-the-art language models, including GPT-4o (OpenAI), GPT-3.5 (OpenAI), GPT-4 (OpenAI), Claude (Anthropic), PaLM (Google), LLaMA and LLaMA 2 (Meta), Gemini, and many others. This flexibility allows you to choose the model that best suits your specific use case, whether you're building a chatbot, a content creation tool, or any other AI-powered application. You can experiment with different models and find the one that delivers the best performance for your project.

How can I integrate Discord into my project?

Composio.dev provides a seamless integration for Discord, making it super easy to incorporate this powerful framework into your projects. You can leverage the Composio.dev API to call functions from Discord, allowing you to tap into its capabilities with just a few lines of code. The SDK is available in Python, JavaScript, and TypeScript, so you can work with your preferred programming language and integrate Discord into your projects seamlessly.

What is the pricing for Discord?

Discord is completely free to use, with a generous free tier that allows up to 1000 requests per month. This makes it accessible for developers and organizations of all sizes to explore and experiment with this powerful tool without any upfront costs. Whether you're a student working on a personal project or a startup building the next big thing, you can get started with Discord without worrying about breaking the bank.

What kind of authentication is supported for Discord?

Discord supports OAuth2 authentication, ensuring secure and authorized access to its functionalities. You can leverage the Composio.dev API to handle authentication and call functions from Discord seamlessly. The SDK is available in Python, JavaScript, and TypeScript for your convenience, making it easy to integrate authentication into your projects and keep your users' data safe and secure.

Can I add Discord to my project?

Absolutely! You can easily incorporate Discord into your project by utilizing the Composio.dev API. This API allows you to call functions from Discord, enabling you to leverage its capabilities within your application. The SDK is available in Python, JavaScript, and TypeScript to facilitate integration, so you can work with the language you're most comfortable with and add Discord to your project with ease.

What is the accuracy of Discord?

Discord is designed to provide highly accurate and reliable results, ensuring that your AI applications perform at their best. The integration with Composio.dev ensures precise function calls, enabling you to build robust and powerful AI applications with confidence. Discord's comprehensive framework and the ability to leverage state-of-the-art models ensure reliable and accurate outcomes for your AI development needs, whether you're working on a chatbot, a content creation tool, or any other AI-powered project.

What are some common use cases for Discord?

Discord can be used for a wide range of AI applications, making it a versatile tool for developers and creators alike. Some common use cases include natural language processing, text generation, question answering, sentiment analysis, and more. It's particularly useful for building chatbots, virtual assistants, content creation tools, and other AI-powered applications that can help you automate tasks, engage with users, and create compelling content. Whether you're working on a personal project or building a product for your startup, Discord can help you bring your ideas to life.

How does Discord handle data privacy and security?

Data privacy and security are crucial considerations when working with AI systems, and Discord takes these issues seriously. It follows industry best practices and adheres to strict data protection regulations, ensuring that your data is kept safe and secure. Discord provides robust security measures, such as encryption and access controls, to ensure the confidentiality and integrity of your data. You can rest assured that your sensitive information is protected when using Discord for your AI development needs.
+ Integrate seamlessly with your agentic frameworks
Composio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and Sizes
Building for AI across continents🧪