![]() |
VOOZH | about |
dotnet add package Ananke.Platforms.Discord --version 0.8.5
NuGet\Install-Package Ananke.Platforms.Discord -Version 0.8.5
<PackageReference Include="Ananke.Platforms.Discord" Version="0.8.5" />
<PackageVersion Include="Ananke.Platforms.Discord" Version="0.8.5" />Directory.Packages.props
<PackageReference Include="Ananke.Platforms.Discord" />Project file
paket add Ananke.Platforms.Discord --version 0.8.5
#r "nuget: Ananke.Platforms.Discord, 0.8.5"
#:package Ananke.Platforms.Discord@0.8.5
#addin nuget:?package=Ananke.Platforms.Discord&version=0.8.5Install as a Cake Addin
#tool nuget:?package=Ananke.Platforms.Discord&version=0.8.5Install as a Cake Tool
Discord adapter for Ananke - bridges Discord Gateway events to Ananke agent workflows via IMessagePlatformAdapter. Supports streaming chat responses using the post-then-edit pattern with automatic debouncing.
dotnet add package Ananke.Platforms.Discord
bot + permissions Send Messages, Read Message History, Add Reactionsusing Ananke.Platforms;
using Ananke.Platforms.Discord;
services.AddAnankeDiscord(options =>
{
options.BotToken = config["Discord:BotToken"]!;
});
services.AddSingleton<IPlatformMessageHandler, MyAgentHandler>();
| Service | Implementation |
|---|---|
IMessagePlatformAdapter |
DiscordAdapter - connects via Discord Gateway (WebSocket), dispatches incoming messages |
IPlatformResponseSink |
DiscordResponseSink - sends/edits messages, typing indicators, reactions via Discord API |
IHostedService |
DiscordHostedService - starts/stops the adapter with the application host |
Discord threads are mapped automatically:
| Discord context | PlatformMessage.ChannelId |
PlatformMessage.ThreadId |
|---|---|---|
| Regular channel message | Channel ID | null |
| Thread message | Parent channel ID | Thread channel ID |
/command bridgeWhen SlashCommandTools is set, every tool in the kit is registered as a Discord slash command on startup. Users invoke tools directly — the LLM is not involved.
var tools = new ToolKit("my-tools")
.AddTool("current_time", "Returns the current UTC time.",
() => ToolResult.Ok(DateTime.UtcNow.ToString("u")))
.AddTool("echo", "Echoes input back.", b => b
.Param("text", "The text to echo")
.OnExecute(async args => ToolResult.Ok(args.Get("text"))));
services.AddAnankeDiscord(options =>
{
options.BotToken = config["Discord:BotToken"]!;
options.SlashCommandTools = tools;
// Optional: register to a test guild for instant propagation during dev
// (global commands can take up to an hour to appear)
// options.TestGuildId = 123456789012345678;
});
This gives users /current_time and /echo text:hello in the Discord command picker with full autocomplete and type validation.
| Step | Detail |
|---|---|
| Registration | On Ready, tools are registered via BulkOverwriteGlobalApplicationCommandsAsync (atomic — stale commands from previous runs are removed) |
| Execution | SlashCommandExecuted → extract args → tool.ExecuteAsync(args) → respond with result |
| Timeout | Uses DeferAsync + FollowupAsync — no 3-second limit on tool execution |
ToolParameter.JsonType |
Discord option type | Discord validates |
|---|---|---|
"string" |
String | Free text |
"integer" |
Integer | Whole numbers only |
"number" |
Number | Decimal numbers |
"boolean" |
Boolean | True/False toggle |
Full docs, demos, and architecture: github.com/sevensamurai/Ananke
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.