Skip to main content
This guide provides a quick overview for getting started with Discord tooling in langchain_discord. For more details on each tool and configuration, see the docstrings in your repository or relevant doc pages.

Overview

Integration details

Tool features

  • DiscordReadMessages: Reads messages from a specified channel.
  • DiscordSendMessage: Sends messages to a specified channel.

Setup

The integration is provided by the langchain-discord-shikenso package. Install it as follows:

Credentials

This integration requires you to set DISCORD_BOT_TOKEN as an environment variable to authenticate with the Discord API.
You can optionally set up LangSmith for tracing or observability:

Instantiation

Below is an example showing how to instantiate the Discord tools in langchain_discord. Adjust as needed for your specific usage.

Invocation

Direct invocation with args

Below is a simple example of calling the tool with keyword arguments in a dictionary.

Invocation with ToolCall

If you have a model-generated ToolCall, pass it to tool.invoke() in the format shown below.

Chaining

Below is a more complete example showing how you might integrate the DiscordReadMessages and DiscordSendMessage tools in a chain or agent with an LLM. This example assumes you have a function (like create_agent) that sets up a LangChain-style agent capable of calling tools when appropriate.

API reference

See the docstrings in: for usage details, parameters, and advanced configurations.