lightning
build cross-platform bots
get started -> api docs ↗ Codeberg ↗
lightning is framework that allows you to build cross-platform bots without worrying about platform-specific code. The framework is built in Go, making it easy to work with, and is designed to handle things like commands, events, rate-limits, attachments, and more, all while being battle-tested in Bolt, which has handled millions of messages during just January, 2026.
The framework consists of the core library, which is platform-agnostic, and plugins, which add support for specific platforms. The only platform-specific code is in the plugins, making it possible to support new platforms without modifying your bot’s core logic.
To see a simple example of how to use the framework, check out the framework: hello world guide, which will walk you through creating a simple bot that responds to messages and commands. For the full documentation, check out the api docs.
architecture
The framework is built around a few key concepts:
- package
lightning: The core library, with the platform-agnostic stuff, such as commands, events, and the definition of the plugin interface. - plugins: The platform-specific code, which implements the plugin interface. Each plugin is a separate package, which can be imported and used.
- event handlers: Functions that are called when specific events occur,
like a sent message. These can be registered with the
AddHandlermethod. - commands: Actions that users can trigger, like
/ping, or!help. These can be registered with theAddCommandmethod.
features
- Cross-platform: the framework is designed to be cross-platform, with support for multiple platforms, including Discord, Spacebar, Harmony, Fluxer, Stoat, Matrix, Telegram, and IRC. More platforms can be added by creating new plugins.
- Attachment support: the framework deals with attachments, allowing you to send and receive files, images, and other media by URL.
- Embed handling: embeds are supported across platforms, even if the platform doesn’t support them natively.
- Emoji handling: emojis are supported across platforms, with custom emoji handled natively where possible.