https://github.com/amatsagu/tempest
Fast and secure functions to build scalable Discord Applications.
https://github.com/amatsagu/tempest
app application bot discord discord-api go golang library tempest
Last synced: about 1 month ago
JSON representation
Fast and secure functions to build scalable Discord Applications.
- Host: GitHub
- URL: https://github.com/amatsagu/tempest
- Owner: amatsagu
- License: bsd-3-clause
- Created: 2022-06-01T19:26:52.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-12-11T16:21:52.000Z (about 2 months ago)
- Last Synced: 2025-12-12T18:20:33.201Z (about 1 month ago)
- Topics: app, application, bot, discord, discord-api, go, golang, library, tempest
- Language: Go
- Homepage:
- Size: 5.74 MB
- Stars: 73
- Watchers: 6
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
Create lightning fast Discord Applications
Features - HTTP vs Gateway - Getting started - Troubleshooting - Contributing
**Project: Tempest** is a modern, minimal [Discord](https://discord.com) library for building Discord Apps, written in [Go](https://golang.org/). 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](https://github.com/bsdlp/discord-interactions-go), which is too low-level and outdated.
### Features
- [x] Secure HTTPS-based communication with the Discord API using `crypto/ed25519`
- [x] Automatic dispatching of:
- [x] Application commands
- [x] Message components (buttons, select menu, text input)
- [x] Autocomplete interactions
- [x] Modal interactions
- [x] Built-in basic rate limit management that respects Discord’s HTTP limits
- [x] Full file upload support (message attachments) as stream (over x4 times faster than regular multipart creation)
- [x] Lightweight, fast command manager for auto handling slash commands, their auto complete and subcommands
- [x] Performance focused approach:
- Structs only contain fields usable without a Gateway session
- Essentially no caching for very low resource usage & easier hosting
- [x] Built-in helpers for component & modal interaction flow:
- [Supports buttons, select menus, text inputs, and modals](https://pkg.go.dev/github.com/amatsagu/tempest#Client.AwaitComponent)
- Includes timeout support and flexible interaction flows
- Works with both [static](https://pkg.go.dev/github.com/amatsagu/tempest#Client.RegisterComponent) and [dynamic](https://pkg.go.dev/github.com/amatsagu/tempest#Client.AwaitModal) handlers
- [x] Helper structs and methods to manage:
- [x] Simple messages
- [x] Embeds
- [x] Components (buttons, string selects, sections, etc.)
- [x] Modals
- [x] Bitfields (flags, permissions, etc.)
- [x] [Message Components v2](https://discord.com/developers/docs/components/overview)
- [x] Exposed Rest client and all API structs which allows to easily extend library capabilities if needed
- [x] **__Basic__** support for Discord Monetization API *(enough to get started)*
### HTTP vs Gateway
**TL;DR**: you probably should be using libraries like [DiscordGo](https://github.com/bwmarrin/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.
> \** Since v1.4 - Tempest can also run same code over gateway, simply swap `HTTPClient` to `GatewayClient`. Your existing bot/app code should be backward compatible. This option exists for large Discord Applications that outgrow initial plans and now require more reliable connection / lower latency for its users. Check usage at `example/cmd/example-bot/main.go`.
### Getting started
1. Install with: `go get -u github.com/amatsagu/tempest`
2. Check [example](https://github.com/amatsagu/tempest/blob/master/example) with few simple commands.
## Troubleshooting
For help feel free to open an issue on github.
You can also inivite to contact me on [discord](https://discord.com/users/390394829789593601).
## Contributing
All contributions are welcomed.
Few rules before making a pull request:
* Use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/),
* Add link to document for new structs,
* Check [extra code notes](https://github.com/amatsagu/tempest/blob/master/CODE_NOTES.md) to get familiar with few rules I use when writing writing this lib
[](https://app.fossa.com/projects/git%2Bgithub.com%2FAmatsagu%2FTempest?ref=badge_large)