Skip to content

Releases: serenity-rs/serenity

v0.6.0-rc.2

14 Jun 11:08
Compare
Choose a tag to compare

Thanks to the following for their contributions:

A crucial release fixing a lot of misbehaviour:

Added

Fixed

Changed

Removed

Read more

v0.5.14

17 May 19:44
Compare
Choose a tag to compare

This release fixes a few bugs.

Thanks to the following for their contributions:

Added

Changed

Fixed

  • [model] Handle serde_json's "arbitrary precision" feature. (@acdenisSK) c:33f4adf
  • [framework] Do not display commands their help_available is set to false. (@Lakelezz) c:1705338
  • [framework] Ignore bots when using the help-command if framework's ignore_bots is set to true. (@acdenisSK) c:e40758e
  • [misc.] Rename the methods-feature inside the third example to utils. (@Lakelezz) c:a7ee6a6

v0.6.0-rc.1

14 May 17:14
Compare
Choose a tag to compare

Thanks to the following for their contributions:

A short release for some things we overlooked.

Added

Fixed

Changed

v0.6.0-rc.0

06 May 17:28
Compare
Choose a tag to compare

Thanks to the following for their contributions:

Release candidate

This is a testing release for receiving feedback regarding the new big changes introduced, whether they’re satisfactory, or horrid and should be revised, before we officially stabilise them.

Please inform us of any suggestions, or bugs you might have!

Major breaking changes

Serenity has migrated to the 2018 Rust edition, whose lints and idioms are enforced in its codebase.

The cache and http are no longer globally accessible. The Context now carries instances to them, and as such, all functions that had used the cache and http before, now accept the context as their first parameter in order to operate. Passing the fields present on the context is acceptable too.

The framework had been swayed off of builders, and proselytised to procedural, macro-based attributes.
Giving options to your commands might have looked like this:

command!(foo(ctx, msg, args) {
    ...
});

framework.command("foo", |c| 
   c.description("I am foobar")
       .min_args(1)
       .max_args(2)
       .usage("#foo bar baz")
       .cmd(foo));

But now, it will be:

#[command] // Marks this function as a command.
#[description = "I am foobar"] // These are the "parameter" attributes, for providing the options to the attribute macro.
#[min_args(1)]
#[max_args(2)]
#[usage("#foo bar baz")]
fn foo(ctx: &mut Context, msg: &Message, args: Args) -> CommandResult {
    ...

    Ok(())
}

The same happened to creating groups, but with macro! style flavour, which have become a compulsory step in registering your commands:

group!({
    name: "fizzbuzz",
    options: {
        prefix: "fezz",
        ...
    },
    commands: [foo],
});

All .commands and .ons are thus replaced with simple calls to .group:

framework.group(&FIZZBUZZ_GROUP); // !

! - procedural macros are functions that accept Rust code, return Rust code. The Rust code that the #[command] (and similarly, group!) macro generates is the function you supplied it with, and a static instance of options that you've configured the command with. The static is assigned a suffixed, all uppercase version of the function’s name (or in the case of group!, of the name field). Hence this weird identifier from nowhere.

Book

To help new (and existing) users familiarise themselves with the library better, we have decided to write a book similar to one of Rust's official learning material to the language, The Book.

It's no ready yet, but we hope that on its release that it will clear misunderstandings (if any), explain the why and how of the library and put you in the right direction of Discord bot making!

Added

Changed

  • [model] Make MessageUpdateEvent::embeds a Vec (@zeyla) c:00f465c
  • [voice] Voice fixes, better API adherence, bitrate control, documentation (@FelixMcFelix) c:393a5ae
  • [builder] Make builders mutably borrowed (@zeyla, @Flat, @Lakelezz, @Celti) c:1546171 c:6d87d71 c:b7a6fee c:b012ab7
  • [utils] Make Message Builder use &mut self instead of self (@PvdBerg1998) c:1546171
  • [misc.] Update parking_lot and multipart dependencies (@Kroisse) c:1e50d30
  • [framework] Make sure delimiter clears current and default delimiters. (@Lakelezz) c:3f81cf3
  • [framework] Underline command name and "Commands" in plain help (@hyarsan) c:87bc6ca
  • [http] Replace hyper with reqwest (@Lakelezz) c:86a8b60
  • [client/gateway] Switch to tungstenite from rust-websocket (@zeyla) c:a5aa2a9
  • [misc.] Update to Rust 2018 (@Lakelezz) [c:21518c8]
  • [http/model/all] Remove global Cache and HTTP (@Lakelezz) [c:712cfa5] [c:3f0ea69]
  • [client] Change the Context::data field to use an RwLock (@Erk-) [c:661d778]
  • [cache] Pass old Message to message_update (@Mishio595) [c:40bf272]
  • [framework] Check for Ownership in Help System (@Lakelezz) [c:fa0376c]
  • [framework] Improve Help Consistency (@Lakelezz) [c:51b48f4]
  • [misc.] Adhere to Rust 2018's idioms (@Lakelezz) [c:5d6dc37]
  • [client] Add different Context::news based on feature-set. (@Lakelezz) [c:625b764]
  • [framework] Remodel Args's API (@acdenisSK) [c:c472ddd]
  • [framework] Rewrite the framework to attributes (@acdenisSK) [c:cc81e47]
  • [framework] Handle Sub-Groups in the Help-System (@Lakelezz) [c:9b591ec]
  • [voice] Fewer ffprobe calls when playing audio through ffmpeg (@FelixMcFelix) [c:5dff7eb]
  • [voice] Optional impls and additional events for AudioReceiver (@FelixMcFelix) [c:d955df4]
  • [voice] ClientConnect message handling (@FelixMcFelix) [c:fa11a30]
  • [client] Pass the old voice state if the cache is enabled (@andreasots) [c:bd45e42]
  • [http] Specify Header's Content Length as 0 (@eatsfoobars) [c:a713b40]
  • [voice] Switch to audiopus (@Lakelezz) [c:4af7a98]
  • [model] Make enums non-exhaustive (@Lakelezz) [c:9cc8816]
  • [http] Make the HttpError Send+Sync (@Erk-) [c:6cfc0e1]
  • [framework] Update on_mention to take a UserId (@Celti) [c:d995fa0]
  • [utils] Simplify from_rgb, turn some of Colour's functions to const. (@hyarsan) [c:c149e36]

Fixed

  • Fix ActivityFlags/ActivityTimestamps/ActivityParty deserialization (@zeyla) [c:0a77330] [c:d01eeae]
  • Fix MessageBuilder's doctests (@Flat) [c:a3477a2]

Removed

  • [client] Remove deprecated Context::edit_profile (@zeyla) [c:bc0d82e]
  • [misc.] Remove everything marked deprecated since v0.5.x or older (@Lakelezz) [c:70720ae]
Read more

v0.5.13

10 Mar 14:25
Compare
Choose a tag to compare

Thanks to the following for their contributions:

Breaking change

As unusual as it may sound for a patch version, we had to bump our minimum supported Rust version to 1.31.1 as a consequence of certain dependencies publishing releases containing uncompilable code for 1.25 rustc.

Added

Changed

  • [docs] Compile, but do not run tests that were previously ignored (@MOZGIII) c:00990c0
  • [misc.] Lock cc and base64 dependencies to specific versions (@Lakelezz) c:bc3d978
  • [general] Update Discord's welcome messages as of 2018-12-19 (@Erk-) c:e94388
  • [voice] Fewer ffprobe calls when playing audio through ffmpeg (@FelixMcFelix) c:cfcd342 (Improperly credited under @acdenisSK due to a hiccup on Github's part.)
  • [misc.] Define 1.31.1 as the new minimum Rust version (@acdenisSK) c:07e81b0
  • [misc.] Revert commit c:bc3d978 (@acdenisSK) c:498e41c
  • [misc.] Bump sodiumoxide to version 0.2 (@DoumanAsh, @MOZGIII) c:23ae9d8 (Commit done by @acdenisSK, but the intention to upgrade the version were Douman's and Mozgiii's)

Fixed

  • [model] Fix "no-cache with http" feature combo of has_role (@Erk-) c:3899547
  • [docs] Use a normal main to fix Rust 1.25 compilation (@acdenisSK) c:b469611
  • [docs] Fix wording of timestamp's documentation (@acdenisSK) c:7c09cdd
  • [misc.] Fix typos and perform some language improvements (@ijks) c:88d914e
  • [docs] Fix tests to work with default features without cache (@Lakelezz) c:e6694f2
  • [voice] Fix connection error being thrown on leaving voice (@JellyWX) c:62a1aa2

v0.5.12

14 Feb 18:12
Compare
Choose a tag to compare

ferrisi-holding-heart-together
Done by @Erk-

❤️ Be at peace, be in love.
Make code, not language wars. ❤️

This is a celebratory release for Valentine's day, which we present to you with utmost courtesy.
(It is also @Erk-'s birthday. Lucky guy.)

Thanks to the following for their contributions:

Upgrade Path

typemap does not need to be pulled in as a dependency for serenity anymore.
You can remove typemap from your #[dependencies] table in your Cargo.toml and simply import its types from the prelude:

use serenity::prelude::{ShareMap, TypeMapKey};

Added

  • [model] Add a position propagation method to Channel (@Erk-) c:2cb67df
  • [model] Implement Into<u64> and Into<i64> for ID types (@Lakelezz) c:794393c
  • [general/prelude] Re-export ShareMap and Key types from typemap (@zeyla) c:b11b4e2
  • [utils/MessageBuilder] Add support for spoilers (@acdenisSK) c:a56d014
  • [general/example] Add usage of colour in example 11 (@Erk-) c:7066ed2

Changed

Fixed

By the way, here's some chocolate for reading these release notes 🍫

v0.5.11

12 Nov 22:07
Compare
Choose a tag to compare

Mini-release.

Thanks to the following for their contributions:

Added

Changed

v0.5.10

05 Nov 00:04
Compare
Choose a tag to compare

This is a celebration release for the anniversary of the failed Gunpowder Plot enacted against King James of England and Scotland in 1605.
FerrisFawkes
Image done by @Lakelezz

Thanks to the following for their contributions:

Known issues

Systems with OpenSSL 1.x.x installed will not be able to compile Serenity as it depends on an older version of OpenSSL (0.9.x). To circumvent this, you need to add a patch section to your Cargo.toml for ishitatsuyuki's fork, which is compatible with 1.x.x, like so:

[patch.crates-io]
openssl = { git = "https://github.com/ishitatsuyuki/rust-openssl", branch = "0.9.x" }

Upgrade Path

Discord no longer considers channels with the prefix nsfw- in their name as NSFW. Per c:75fb5c04, the utils::is_nsfw has been deprecated. Instead, the is_nsfw methods on the channel structs (as in GuildChannel::is_nfsw) are to be used for checking their nsfw-ness.

Added

Fixed

Misc.

v0.5.9

15 Sep 05:18
Compare
Choose a tag to compare

This is a maintenance release fixing a number of bugs with a few miscellaneous
internal changes.

Thanks to the following for their contributions:

Upgrade Path

There are no deprecations or breaking changes.

Added

Fixed

Misc.

v0.5.8

12 Aug 19:59
Compare
Choose a tag to compare

Thanks to the following for their contributions:

Upgrade Path

Per c:71edc3a, methods on ID structs like ChannelId::find have been
deprecated and replace with UserId::to_channel_cached. Similarly, methods like
GuildId::get have been replaced with GuildId::to_partial_guild. While the
original methods have not been removed, they have been deprecated.

Added

Fixed

Changed

  • [model] Add to_*, as_* methods on Id types, deprecate get and find
    methods (@Lakelezz) c:71edc3a

Misc.