A simple to use async Nim library which aims to use Discord's rich presence API with ease
- It's async
- Works on both Unix and Windows
- Has no external dependencies
- It's easy to use (check examples folder)
$ nimble install https://github.com/DavideGalilei/nimpresence
Go to https://discord.com/developers/applications, authenticate, create an application, and get its client id. I will leave mine in the examples to make them reproducible.
discard await presence.update(
state = some "Test #1",
details = some r"`\(^~^)/`"
`end` = some getTime().toUnix() + 1000,
buttons = some @[
Button(label: "aaaaa", url: "https://google.com"),
Button(label: "aaaaa", url: "https://google.com")
]
)
โ ๏ธ If the library is not working
- Mixing parameters such as match/spectate/join with buttons is not permitted, and will not update your presence (try with different options)
- If you make too much requests in a short while, discord may ratelimit you for some minutes, try again later
- If it gives compile errors, remember that you need to use the
some
function fromstd/options
library, since optional parameters are used inPresence.update(...)
Special thanks to pypresence, which let me understand how Discord's socket works.
This project is under MIT license.