Tempest is a Discord API wrapper for Applications, written in Golang. It aims to be fast, use minimal caching and be easier to use than other Discord API wrappers using http.
It was created as a better alternative to discord-interactions-go which is "low level" and outdated.
- HTTP vs Gateway
- Supported discord features
- Special features
- Getting Started
- Troubleshooting
- Contributing
TL;DR: you probably should be using libraries like DiscordGo unless you know why you're here.
There are two ways for bots to recieve 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 HTTP. Using http connection lets you easily split your bot into microservices and use far less resources as opposed to gateway but will receive less events. As such, there are some major points to keep in mind before deciding against using gateway.
Tempest since v1.1.0
supports all discord features (allowed over HTTP) except file transfer. You can accept files but there's currently no support for sending own files. Other elements like command auto complete, components or modals have full support.
- Easy to use & efficient handler for (/) commands & auto complete interactions
- Deep control with command middleware(s)
- Exposed REST
- Easy component & modal handler
- Simple way to sync (/) commands with API
- Auto panic recovery inherited from
std/http
- Request failure auto recovery (3 attempts)
- On failed attempts (probably due to internet connection), it'll try again up to 3 times before returning error
- Cache is optional
- Applications/Bots work without any state caching if they only prefer to (avoid dynamic handlers to do it).
- 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.
Contributions are welcomed but for bigger changes I would like first reaching out via Discord (invite amatsagu
, id: 390394829789593601
) or create an issue to discuss your problems, intentions and ideas.
Few rules before making a pull request:
- Use conventional commits
- Avoid using interfaces, generics or any/interface{} keywords
- As we focus on max performance, those elements should be skipped unless required to go forward
- Add link to document for new structs
- Since
v1.1.0
, all structs have links to corresponding discord docs
- Since