Releases: hitblast/filthy-rich
Releases · hitblast/filthy-rich
Release list
v1.0.6
v1.0.5
Internal changes:
- Code quality improvements.
v1.0.4
New features:
- Added
PresenceRunner::can_connectfor checking if a Discord client is available for connection. This works without the initialization ofPresenceRunner. - Added two new type aliases:
RPCRunner(alias forPresenceRunner)RPCClient(alias forPresenceClient)
v1.0.3
Internal changes:
- Added a new
retry!macro for minimizing some duplicate code related to incrementing the retries counter and executing the passed closure fromon_retry. - Added a new
str!macro globally which aids with generating functions returning&strfromStringfields (yeah, I'm lazy).
v1.0.2
Changes:
- Removed exponential backoff as it was largely unused. It has been replaced with a
RETRY_DELAYconstant with the value being 1 second.
Internal changes:
Opcodeis nowPartialEq-compatible and is directly parsed withread_frame()as a part of theFrameobject.- Made
DiscordSock::writeprivate assend_frameis used throughout most of the code, and bare-bones writes are risky. - Removed the internal
connectflag.
v1.0.1
This release primarily focuses on optimizations.
Changes:
- Closures passed in with
on_*event functions now spawn those functions in a separate thread for leaving no obstructions in the inner loop.
Internal changes:
- The
tokio::select!for receiving commands and reading frames is now unbiased again, giving equal priority to both of them.
v1.0.0
Finally, a stabilized API for filthy-rich!
New features:
- Added a new
ActivitySpectype which basically replaces the current architecture of a mutableActivityto a post-built, immutable object which can be sent around. - Added
Activity::empty_specwhich gives an empty but usableActivitySpec(basically executesActivitySpec::defaultinternally). ActivityResponseDatanow includes anActivityPayloadobject (flattened internally) instance for you to directly see which activity details were sent.- Completed the
ReadyDatastruct with these changes:- New fields in
ReadyData:
v- RPC version (u8)config- server configuration (a newServerConfigurationDataobject)
- The inner
userfield (with typeDiscordUser) now has the complete specification of struct fields documented in the official Discord RPC documentation.
- New fields in
Changes:
ActivityBuilder::buildnow returnsResult<ActivitySpec, ActivitySpecBuildError>with all of its niceties (guardrails for you to bring your Rich Presence to life with safety).- All of the asset keys/values/URLs which can be passed through the builder functions are now
None-filtered. PresenceRunner::newnow accepts any type of value forclient_idas long as it implementsInto<String>.ActivityResponseDatanow only gives out borrowed read-only data through functions (e.g.ActivityResponseData::namenow returnsOption<&str>).- The change above also has been done to
ReadyData. - Removed unused
derivemacros fromActivitysince its now just a placeholder struct for accessingActivityBuilderwith no values attached to it. - A lot of improvements to the documentation for various items in the library!
Bug fixes:
- Fixed a fatal bug in ping-pong logic which led to the sending of frames with
PINGand notPONGin response toPING.
Internal changes:
- Added an idiomatic
Opcodeenum and bettered code quality for matching opcodes in thesocket.read_frame()loop inside ofPresenceRunner. - Removed the use of
Arcfrom the innerreadhalfandwritehalffields ofDiscordSocksince the main loop doesn't cross thread boundaries. - Added a new
DisconnectReason::OldRelicComputererror. ActivityPayload,TimestampPayload,ButtonPayloadandAssetsPayloadare all public structs now. Their fields can be accessed using functions which point to borrowed data.- The
typesmodules is now separated into many other modules internally. - Optimized some reusable syntax for
PresenceRunnerwith macros for a better developer experience. - Removed the
acquire!()macro fromDiscordSock.
v0.14.1
Internal changes:
- Removed unsafe buffer init from the internal
DiscordSock::read_framefunction and implement aMAX_FRAME_SIZE, which, if crossed, returns aDiscordSockError::PayloadTooLargeerror from the function (thanks to @Sreehari425) (see pull request).
v0.14.0
New features:
- Added
PresenceRunner::on_retryfor accepting a closure to execute during socket creation / handshake retries. The returnedusizevalue (through the closure parameter) indicates the amount of total retries done at the time of the closure's execution. - Added
PresenceRunner::set_max_retriesfor enabling developers to set a custom retry count for socket creation / handshakes after which the runner instance should give up on connecting to Discord. By default this is set to0(indefinite) internally.
Bug fixes:
- Fixed a bug which had prevented the closure passed through
on_activity_sendfrom firing due to improper fields in arRPC.
API changes:
PresenceClient::client_idnow returns an&strinstead of a clonedString.- All fields for the
ActivityResponseDatastruct have been made optional.
Internal changes / improvements:
- Use
BytesMut/Bytesinstead of standardVec<u8>in places (added a newbytescrate to the dependencies list). - Removed multiple writes from
send_frameand instead merged them into a single logical write. - Removed the
json!()macro call fromDiscordSock::do_handshakeand replaced it withPresenceHandshake. - Removed unused derive macros from several structs in the
typesmodule. - Minor optimizations have been done to
ActivityCommand.
v0.13.2
Improvements:
- Much smaller
tokiobundle (removed thefullfeature set in favor of a more intentional list of features).