grevolt

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: MIT

README

Grevolt

A low-level library for Revolt focused on being up-to-date and feature-complete with Revolts current API while also being well tested with unit tests and providing a high level of control over all parts of the library to allow both small and large bots to thrive.

Grevolt seperates low-level Client operations from more higher level abstractions by providing extra, a collection of additional utilities for common tasks such as more complex event handling, command handling (TODO) and more!

Why grevolt?

Other libraries had many flaws when inspected. Not to blame these projects, but here are some of the issues I found.

Revolt goes down a lot and in the future may even spew out invalid JSON as it grows, and panicking here is simply infeasible for larger bots. Grevolt instead returns an error and allows the user to handle it for example by restarting the bot or logging the error in a database for example. In addition to this, these libraries often don't Ping the 'official client' way (data is supposed to be a timestamp and not a constant)

Also, panicking on failing to read a message isn't ideal and libraries should aim to try and restart the websocket instead of outright panicking.

Concurrent map writes in Go are not allowed making such libraries highly infeasible for large bots.

Testing

Run go test -v ./... to test stuff

TODO

  • Better usage examples
  • Command handling framework

Credits

Heavy work in progress

Directories

Path Synopsis
Package auth contains the struct for auth
Package auth contains the struct for auth
cache
extras
advancedevents
Package advancedevents provides a much more advanced event and error handling framework for events
Package advancedevents provides a much more advanced event and error handling framework for events
broadcast
https://betterprogramming.pub/how-to-broadcast-messages-in-go-using-channels-b68f42bdf32e
https://betterprogramming.pub/how-to-broadcast-messages-in-go-using-channels-b68f42bdf32e
ratelimits
Ratelimits impl from https://github.com/bwmarrin/discordgo/blob/master/ratelimit.go
Ratelimits impl from https://github.com/bwmarrin/discordgo/blob/master/ratelimit.go
restcli
+interactions <in docs but its actually reactions>
+interactions <in docs but its actually reactions>
flags
Note that while types.go is autogenerated, this file is NOT and is manually maintained
Note that while types.go is autogenerated, this file is NOT and is manually maintained
flags/permissions
Defines permissions flags, taken from https://github.com/revoltchat/backend/blob/master/crates/quark/src/permissions/defn/permission.rs
Defines permissions flags, taken from https://github.com/revoltchat/backend/blob/master/crates/quark/src/permissions/defn/permission.rs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL