Create lightning fast Discord Applications
Project: Tempest is a modern, minimal Discord library for building Discord Apps, written in Go. It aims to be extremely fast, stay very close to the Discord API, and include little to no caching - making it an excellent choice for small VPS or serverless architecture. In real-world projects using this lib, your bottlenecks will 9/10 cases be in the database or network bandwidth, not in app/bot itself.
It was created as a better alternative to discord-interactions-go, which is too low-level and outdated.
- Secure HTTPS-based communication with the Discord API using
crypto/ed25519
- Automatic dispatching of:
- Application commands
- Message components (buttons, select menu, text input)
- Autocomplete interactions
- Modal interactions
- Built-in basic rate limit management that respects Discord’s HTTP limits
- Full file upload support (message attachments) as stream (over x4 times faster than regular multipart creation)
- Lightweight, fast command manager for auto handling slash commands, their auto complete and subcommands
- Performance focused approach:
- Structs only contain fields usable without a Gateway session
- Essentially no caching for very low resource usage & easier hosting
- Built-in helpers for component & modal interaction flow:
- Supports buttons, select menus, text inputs, and modals
- Includes timeout support and flexible interaction flows
- Works with both static and dynamic handlers
- Helper structs and methods to manage:
- Simple messages
- Embeds
- Components (buttons, string selects, sections, etc.)
- Modals
- Bitfields (flags, permissions, etc.)
- Message Components v2
- Exposed Rest client and all API structs which allows to easily extend library capabilities if needed
- Basic support for Discord Monetization API (enough to get started)
- Support for new HTTP event webhooks (planned):
- Application Authorized
- Application Deauthorized
- Entitlement Create
TL;DR: you probably should be using libraries like DiscordGo unless you know why you're here.
There are two ways for bots to receive events from Discord. Most API wrappers such as DiscordGo use a WebSocket connection called a "gateway" to receive events, but Tempest receives interaction events over HTTPS. Using http hooks lets you scale code more easily & reduce resource usage at cost of greatly reduced number of events you can use. You can easily create bots for roles, minigames, custom messages or admin utils but it'll be very difficult / impossible to create music or moderation bots.
- Install with:
go get -u github.com/amatsagu/tempest
- Check example with few simple commands.
For help feel free to open an issue on github. You can also inivite to contact me on discord.
All contributions are welcomed. Few rules before making a pull request:
- Use conventional commits,
- Add link to document for new structs,
- Check extra code notes to get familiar with few rules I use when writing writing this lib