~/projects/nexium-discord

nexium-discord

A Discord bot library for Nexium: the gateway, the REST calls a bot makes, and events to match on. Heartbeats, resumes and rate limits are handled inside; TLS comes from nxtls, or from the system on Windows.

Nexium

## What it is

nexium-discord is a Discord bot library for Nexium, written in Nexium over its standard library's std.http and std.websocket, with TLS from nxtls. A bot is a loop over bot.next(): the events it wants come back as values to match on, and everything the gateway needs to stay connected (identifying, heartbeats, resuming a dropped session, reconnecting with growing waits) happens inside. Answers go out through REST calls on the same bot, with Discord's rate limits waited out.

## What's in it

## How it's tested

A scripted Discord plays through a transport of its own: a gateway session from Hello to a dispatch, a dropped connection resumed at the URL Discord gave, a refused token, a 429 waited out, slash commands registered. CI runs it on Linux, macOS and Windows, and it has been checked live from Linux and Windows, through both SChannel and nxtls. The gateway, message, interaction and command code come from a bot that has run on them since September 2026.

## Status

0.2.0 covers a bot's everyday: messages, slash commands and their answers, buttons, menus, forms and reactions. Not yet: sharding (for bots in more than 2,500 servers), voice, the gateway's zlib compression, and file uploads. It needs Nexium 1.4 or later, and runs on Linux, macOS, the BSDs and Windows.

← back to all projects