Releases: serenity-rs/serenity
v0.4.1
This release contains bugfixes and some newly added or newly exposed
functionality.
Thanks to the following for their contributions this release:
Added
- [general] Replace Vec parameters by
IntoIterator(@ftriquet)c:55167c3 - [general] Replace slice parameters by
IntoIterator(@ftriquet) c:022e35d - [model] Add
Guild::members_starting_with(@Lakelezz) c:b3aa441 - [model] Add
Guild::members_containing(@Lakelezz) c:1b167b5 - [model]
impl<'a> BanOptions for &'a str(@acdenisSK) c:cf40386 - [model] Derive
DefaultonCurrentUserand IDs (@acdenisSK) c:09a8a44 - [client] Add a configurable, shard-shared threadpool (@zeyla) c:d7621aa,
c:8109619 - [model] Add
Guild::members_username_containing, members_nick_containing
(@Lakelezz) c:002ce3a - [framework] Add an iterator for
Args(@acdenisSK) c:0ed1972 - [framework] Make
has_all_requirementspublic (@Lakelezz) c:08d390c - [framework] Make default help messages list help for aliases (@Lakelezz)
c:0d1c0f1
Fixed
- [model] Use
request_client!for attachment downloading (@lolzballs)
c:71f709d - [client] Fix client no-framework compilation (@zeyla) c:1d4ecb2
- [client] Fix client shards not filling (@zeyla) c:86d8bdd
- [model] Fix
User::tagandCurrentUser::tagdiscrim output (@zeyla)
c:6b9dcf5 - [framework] Modify
initializedmethod purpose (@acdenisSK) c:05f158f - [framework] Make command Error string public (@acdenisSK) c:917dd30
- [client, gateway] Improve shard logic (@acdenisSK, @zeyla) c:683691f,
c:7befcd5 - [gateway] Reset shard heartbeat state on resume (@zeyla) c:c98cae4
- [general] Fix font-height and soften the logo (@Lakelezz) c:3b2c246
Misc.
- [client, gateway] Improve shard and shard runner logging (@zeyla)
c:21e194b to_owned->to_string(@acdenisSK) c:1bf4d9c- [general] Fix most clippy warnings (@Roughsketch) c:7945094
- [framework] Add some docs to
Args(@acdenisSK) c:8572943 - [examples] Add
env_loggerbot example c:0df77b9 - [general] Fix clippy lints (@zeyla) c:483b069
- [model] Optimize
Member::roles(@hsiW) c:8565fa2 - [general] Internally use a
try_opt!macro (@hsiW) c:9b0c053 - [general] Feature-flag extern crates behind their name (@zeyla) c:11b85ca
v0.4.0
This release contains a lot of added functionality, minor-scale rewrites,
bugfixes, documentation work, and the beginning of a rewrite to use the tokio
ecosystem.
The release was delayed due to a [fairly majour bug][rust-websocket:issue:137]
in rust-websocket that we have forked over to temporarily fix.
This release was lead in development by [@acdenisSK].
Thanks to the following for their contributions this release:
- [@acdenisSK]
- [@Arcterus]
- [@Bond-009]
- [@blaenk]
- [@hsiW]
- [@imnotbad]
- [@joek13]
- [@Lakelezz]
- [@Roughsketch]
- [@xentec]
- [@zeyla]
Upgrade Path
Per commits [c:af1061b], [c:cdedf36], and [c:aa307b1], Direct Messaging other
bot users is now disallowed by the API. To fix this, simply don't do it.
Per commit [c:ebc4e51], deprecated functions were finally removed. The following
can simply have their usage renamed:
Cache::get_channel-->Cache::channelCache::get_guild-->Cache::guildCache::get_guild_channel-->Cache::guild_channelCache::get_member-->Cache::memberCache::get_private_channel-->Cache::private_channelCache::get_role-->Cache::roleCache::get_user-->Cache::userChannelId::get_invites-->ChannelId::invitesChannelId::get_message-->ChannelId::messageChannelId::get_messages-->ChannelId::messagesChannelId::get_reaction_users-->ChannelId::get_reaction_usersChannelId::get_webhooks-->ChannelId::webhooksChannel::get_message-->Channel::messageChannel::get_messages-->Channel::messagesChannel::get_reaction_users-->Channel::reaction_usersClient::login_bot-->Client::newClient::login-->Client::newColour::get_b-->Colour::bColour::get_g-->Colour::gColour::get_r-->Colour::rColour::get_tuple-->Colour::tupleCurrentUser::distinct-->CurrentUser::tagGroup::get_message-->Group::messageGroup::get_messages-->Group::messagesGroup::get_reaction_users-->Group::reaction_usersGuild::get_bans-->Guild::bansGuild::get_channels-->Guild::channelsGuild::get_emoji-->Guild::emojiGuild::get_emojis-->Guild::emojisGuild::get_integrations-->Guild::integrationsGuild::get_invites-->Guild::invitesGuild::get_member-->Guild::memberGuild::get_members-->Guild::membersGuild::get_member_named-->Guild::member_namedGuild::get_prune_count-->Guild::prune_countGuild::get_webhooks-->Guild::webhooksGuildId::get_bans-->GuildId::bansGuildId::get_channels-->GuildId::channelsGuildId::get_emoji-->GuildId::emojiGuildId::get_emojis-->GuildId::emojisGuildId::get_integrations-->GuildId::integrationsGuildId::get_invites-->GuildId::invitesGuildId::get_member-->GuildId::memberGuildId::get_members-->GuildId::membersGuildId::get_prune_count-->GuildId::prune_countGuildId::get_webhooks-->GuildId::webhooksMessage::get_reaction_users-->Message::reaction_usersPartialGuild::get_bans-->PartialGuild::bansPartialGuild::get_channels-->PartialGuild::channelsPartialGuild::get_emoji-->PartialGuild::emojiPartialGuild::get_emojis-->PartialGuild::emojisPartialGuild::get_integrations-->PartialGuild::integrationsPartialGuild::get_invites-->PartialGuild::invitesPartialGuild::get_member-->PartialGuild::memberPartialGuild::get_members-->PartialGuild::membersPartialGuild::get_prune_count-->PartialGuild::prune_countPartialGuild::get_webhooks-->PartialGuild::webhooksPrivateChannel::get_message-->PrivateChannel::messagePrivateChannel::get_messages-->PrivateChannel::messagesPrivateChannel::get_reaction_users-->PrivateChannel::reaction_usersRole::edit_role-->Role::editUser::distinct-->User::tag
http::send_file has been replaced by http::send_files. Instead of using http::send_file like so:
use serde_json::Map;
use serenity::http;
use serenity::model::ChannelId;
use std::fs::File;
let channel_id = ChannelId(253635665344987136);
let filename = "mr-sakamoto.png";
let file = File::open(&format!("./img/{}", filename))?;
let map = Map::<String, Value>::new();
http::send_file(channel_id, file, filename, map)?;Instead send an attachment of files, such as:
use serde_json::Map;
use serenity::http;
use serenity::model::ChannelId;
use std::fs::File;
let channel_id = ChannelId(253635665344987136);
let files = vec![
(File::open(&format!("./img/{}", filename))?, filename),
];
let map = Map::<String, Value>::new();
http::send_files(channel_id, files, map)?;Similar logic can be applied to shortcut methods which have been removed,
namely:
Channel::send_file(instead useChannel::send_files)ChannelId::send_file(instead useChannelId::send_files)Group::send_file(instead useGroup::send_files)GuildChannel::send_file(instead useGuildChannel::send_files)PrivateChannel::send_file(instead usePrivateChannel::send_files)
Instead of using the now-removed Channel::delete_messages and
Channel::delete_permission, use the inner channel's method:
use serenity::model::{Channel, ChannelId};
let channel = ChannelId(253635665344987136).get()?;
let message_ids = vec![
MessageId(359845483356749825),
MessageId(359854838403694592),
];
if let Channel::Guild(c) = channel {
c.delete_messages(&message_ids)?;
}Similar logic can be applied to Channel::delete_permission.
Member::find_guild ended up being only a shortcut to the Member::guild_id
structfield. Instead of calling the find_guild method like
member.find_guild(), instead access the structfield directly via
member.guild_id.
The model::permissions::{general, text, voice} methods have been removed, as
they ended up being shortcuts to the model::permissions::PRESET_GENERAL,
model::permissions::PRESET_TEXT, and model::permissions::PRESET_VOICE
constants, respectively.
Per commit [c:ea432af], event handling is now done via implementing a trait.
Instead of passing functions to the client directly like:
use serenity::Client;
use std::env;
let mut client = Client::new(env::var("DISCORD_TOKEN")?);
client.on_message(|ctx, msg| {
// code
});Instead implement the new EventHandler trait:
use serenity::client::{Client, Context, EventHandler};
use serenity::model::Message;
struct Handler;
impl EventHandler for Handler {
fn on_message(&self, ctx: Context, msg: Message) {
// code
}
}
let client = Client::new(env::var("DISCORD_TOKEN")?);Per commit [c:4f2e47f], the deprecated ext module (which has recently only
been a series of re-exports for the cache, framework, and voice modules)
was removed. Instead of using serenity::ext::cache for example, use
serenity::cache.
Per commit [c:878684f], due to the concept of default channels being changed,
GuildId::as_channel_id has been deprecated due to the fact that the ID of the
default channel of a guild will no longer necessarily be the same as the guild's
ID.
If you require this same exact functionality (the GuildId as a ChannelId),
rewrite your code from:
use serenity::model::GuildId;
let channel_id = GuildId(81384788765712384).as_channel_id();to:
use serenity::model::{ChannelId, GuildId};
let guild_id = GuildId(81384788765712384);
let channel_id = ChannelId(guild_id.0);Per commits [c:2b053ea], [c:8cc2300], [c:8e29694], and [c:948b27c], custom
frameworks can now be implemented, meaning that a built implementation is now
passed instead of a base framework being provided and mutated. To use the old
framework, modify code from:
use serenity::Client;
use std::env;
let mut client = Client::new(&env::var("DISCORD_TOKEN")?);
client.with_framework(|f| f
// method calls to mutate framework here
);to the new style:
use serenity::client::{Client, EventHandler};
use serenity::framework::standard::StandardFramework;
use std::env;
struct Handler;
impl EventHandler for Handler { }
let mut client = Client::new(&env::var("DISCORD_TOKEN")?, Handler);
client.with_framework(StandardFramework::new()
// method calls here to mutate framework here
);Per commit [c:fc9eba3d], if you were pattern matching on the
serenity::framework::DispatchError::CheckFailed variant, instead either use or
ignore the matched data by rewriting code from:
use serenity::framework::DispatchError;
// Code to begin dispatch error handling here.
match dispatch_error {
DispatchError::CheckFailed => {
// Handle operation here.
},
// Other variants.
}to:
// The standard implementation is now in a "standard" framework module, but
// that's unrelated.
use serenity::framework::standard::DispatchError;
match dispatch_error {
DispatchError::CheckFailed(_) => {
// Handle operation here.
},
// Other variants.
}Per commits [c:45d72ef], [c:03b6d78], and [c:d35d719], the framework's
command! macro no longer parses arguments' types for you. You are now given an
Args struct that you can retrieve arguments from and parse from to a requested
type that implements FromStr.
For example, a simple sum function that looked like:
#[macro_use] extern crate serenity;
command!(sum(_ctx, msg, _args, x: i64, y: i64) {
let _ = msg.reply(&format!("Result: {}", x + y));
});Now looks like:
use serenity::client::Context;
use serenity::framework::standard::Args;
use s...v0.3.0
This release contains a number of added methods, fixes, deprecations, and
documentation improvements. It brings a module restructure and an upgrade to
rust-websocket v0.20, hyper v0.10, and switching to native-tls, meaning
using an up-to-date rust-openssl v0.9 on Linux, schannel on Windows, and
Secure Transport on Mac. The long-standing issue #56 was closed.
Thanks to the following for their contributions this release:
Upgrade Path
Invite retrieval functions now accept a stats argument. If you don't need
stats, just pass false.
ChannelId::create_permission and GuildChannel::create_permission now accept
a reference, as they do not need to own the overwrite.
The deprecated GuildChannel methods (get_invites, get_message,
get_messages, get_reaction_users, get_webhooks) have been removed. Use
their equivalents without the get_ prefix.
The send_file functions have been deprecated. Use send_files instead by
passing a Vec.
CurrentUser::distinct and User::distinct have been deprecated. Instead use
CurrentUser::tag and User::tag.
User::get has been deprecated. Instead, use UserId::get.
Role::edit_role has been deprecated, renaming it to Role::edit.
time has been removed as a direct dependency, moving to chrono.
Public-facing fields that return time::Timespec or were a String in ISO-3339
format are now chrono::DateTime<UTC>s. Instead use its methods for what was
being done with the Timespecs or strings.
User::direct_message and User::dm now accept a builder to allow for more
complete, yet simple use out of the methods. Instead of passing a &str, use
the provided builder:
// old
user.dm("hello")?;
// new
user.dm(|m| m.content("hello"))?;Client::login has been deprecated. Instead use Client::new:
use serenity::Client;
use std::env;
// old
let client = Client::login(&env::var("DISCORD_TOKEN")?);
// new
let client = Client::new(&env::var("DISCORD_TOKEN")?);Member::guild_id is now no longer an Option<GuildId> -- just a GuildId.
Since this is now always present, Member::find_guild has been deprecated since
the cache now never searches the cache for the guild ID.
The deprecated GuildChannel methods get_invites, get_message,
get_messages, get_reaction_users, and get_webhooks have been removed. Use
their alternatives, such as GuildChannel::invites, instead.
Added
- Add support for retrieving invites with counts (@hsiW) [c:302d771]
- Handle message type 7 (@fwrs) [c:8f88c6b]
- Add
GuildChannel::permissions_for[c:6502ded] - Add
Invite::url(),RichInvite::url()[c:3062981] - Reasonable derive Debug on all items [c:9dae9e6]
- Add more examples and improve others [c:8c0aeac]
- Support adding reactions when creating message (@acdenisSK) [c:77b5b48]
- Add
VerificationLevel::Higher[c:7dbae6b] - Add
CurrentUser::invite_url(@Roughsketch, @Flat) [c:e033ff3],
c:0b95db9 impl From<char> for ReactionType[c:2afab7c]- Implement multiple attachments (@Flat) [c:46b79dd]
- Add
_line+_line_safemethods toMessageBuilder(@Roughsketch)
[c:543b604] - Add docs for
CurrentUser(@Roughsketch) [c:921f7f4] - Add cache docs (@Roughsketch) [c:d367a70]
- Add docs and tests for framework (@Roughsketch) [c:4267bdb]
- Add
ContentforMessageBuilder(@eLunate) c:060b06e - Include more info on ratelimiting debugs [c:d37461b]
- Add
User::refresh[c:8c04d31] - Add some model docs (@Roughsketch) [c:c00f349]
- Add
Message::channel()c:063a52f - Add
CurrentUser::default_avatar_url[c:2d09152] - Add
CurrentUser::face(),User::face()[c:d033909] - Deserialize embed footers [c:e92b667]
- Add
Member::permissions[c:39a28d3] (@acdenisSK) - Add
waitparameter tohttp::execute_webhook[c:dc73d1a]
Fixed
- Don't skip
@everyonerole when checking channel overwrites (@Roughsketch)
[c:b468cbf] - Allow
unreachable_codelint incommand!macro (@Flat) [c:eb43b9c] - Fix incorrect attempted
send_filedeserialization c:0102706 - Fix ratelimits causing 429s in certain situations [c:f695174]
- Check last heartbeat acknowledged in heartbeater [c:ec9b1c7]
- Make client join shards and return [c:175d3a3]
- Make client starts return an error [c:858bbf2]
- Ws read/write timeout after 90s to avoid infinite blocking [c:1700a4a]
- Fix negative nonces failing to deserialize [c:d0b64cd]
- Use HTTPS Connector with remaining HTTP functions c:0d218e0 (@Roughsketch)
Changed
- Restructure modules [c:9969be6]
- Change
create_permissionto take a reference [c:aea9885] - Remove deprecated
GuildChannelmethods [c:ab7f113] Guild::create_channeldoesn't require mutability [c:494cc50]- Deprecate
*User::distinct, add*User::tag[c:6579b1f] - Deprecate
User::get[c:afc571f] - Deprecate
Role::edit_role, addRole::edit[c:c00f349] - Switch to chrono [c:990e611]
- Make
User::direct_message/User::dmaccept a builder c:11a02db - Deprecate
Client::login, addClient::new[c:7990381] - Make
Member::guild_idnon-optional [c:b4bd771] - Remove
Context::channel_idandContext::queue[c:8b504ad] - Make the framework's
dynamic_prefixaccept an&Message[c:2845681] - Deprecate
Channel::delete_messages,Channel::delete_permission[c:7fc49d8] - Make
Message::nonceaserde_json::Value[c:c832009]
Misc.
- Remove deprecated
login_botusage from docs (@hsiW) [c:ae395f4] - Fix call to
VoiceManager::joinin example 06 (@barzamin) [c:6853daf] - Sort default help by group/command names (@Roughsketch) [c:93416cd]
- Move
CreateGroupdocs to the struct [c:71f3dbb] - Don't create group in help if no commands to show (@Roughsketch) [c:4f5fbb5]
- Move user avatar method logic out [c:8360f32]
- Upgrade rust-websocket and hyper, switch to native-tls [c:8f8a059]
- Fix broken links in README [c:51c15d0]
- Remove unused
cookiedependency [c:92f4ec2] - Switch from
#[doc(hidden)]topub(crate)[c:32e07e4] (@acdenisSK) - Re-export all errors from the prelude [c:db0f025]
- Rework shard logic and shard handling [c:601704a]
Module rewrites, optimizations, bugfixes, & more
This is a very large release with a number of rewritten components. The cache
has been rewritten to make use of memory more efficiently, the models directory
has been re-organized, structures are now deserialized via serde and
serde_derive - instead of the custom decoding build script we had - with a
number of bugfixes and other various changes and additions.
Thanks to the following for their contributions this release:
- @acdenisSK
- @Flat
- @fwrs
- @hsiW
- @Roughsketch
- @sschroe
Upgrade Path
Replace uses of ext::cache::ChannelRef with model::Channel.
The following ext::cache::Cache method signatures are now encased in
Arc<RwLock>s and should be handled appropriately:
callchannelguildguild_channelgroupmemberroleuser
Additionally, GuildId::find and UserId::find now return
Option<Arc<RwLock>>s.
Member::display_name now returns a Cow<String> instead of a &str.
client::Context has had most of its methods removed. The methods were mostly
a copy of those on ChannelId. Upgrade by instead calling methods on
ChannelId:
command!(foo(ctx) {
let _ = ctx.say("hello");
});
// is now written as:
command!(bar(_ctx, msg) {
let _ = msg.channel_id.say("hello");
});CreateMessage::nonce has been removed. Instead, simply do not provide a nonce.
ChannelId::edit_message now has an argument signature of:
&self, message_id: M, f: F
where F: FnOnce(CreateMessage) -> CreateMessage, M: Into<MessageId>instead of
&self, message_id: M, text: &str, f: F
where F: FnOnce(CreateEmbed) -> CreateEmbed, M: Into<MessageId>To account for this change, modify code like so:
channel_id.edit_message(message_id, "new content", |e| e);
// now:
channel_id.edit_message(message_id, |m| m.content("new content"));Message::edit has also had an argument signature updated to:
&mut self, f: F where F: FnOnce(CreateMessage) -> CreateMessagefrom:
&mut self, new_content: &str, embed: F where F: FnOnce(CreateEmbed) -> CreateEmbedTo account for this change, modify code like so:
message.edit("new content", |e| e.description("test"));
// now:
message.edit(|m| m.content("new content").embed(|e| e.description("test")));client::rest::accept_invite, Invite::accept, and RichInvite::accept have
been removed. Instead, do not attempt this, as they were userbot functions.
Selfbot support has been completely removed. Review the
[commit message][c:d9118c0] for the long list of details.
Group calls and guild sync have [also been removed][c:c74cc15]. Read the commit
message for all the details.
Instead of defining multiple separate error messages for command framework
message dispatches, match the dispatch error in a single method:
// old code:
client.with_framework(|f| f
.configure(|c| c
.command_disabled_message("The command `%command%` was disabled")
.blocked_guild_message("The owner of this guild has been blocked")
.invalid_permission_message("You don't have permission to use this command")));
// new code:
client.with_framework(|f| f.on_dispatch_error(|_, msg, err| {
match err {
DispatchError::CommandDisabled(command_name) => {
let _ = msg.channel_id.say(&format!("The command `{}` was disabled", command_name));
},
DispatchError::BlockedGuild => {
// this change also allows for more intelligent error messages:
if let Some(guild) = msg.guild() {
let owner_id = guild.read().unwrap().owner_id;
if let Some(user) = CACHE.read().unwrap().user(owner_id) {
let c = format!("The owner - {} - has been blocked", user.name);
let _ = msg.channel_id.say(&c);
return;
}
}
let _ = msg.channel_id.say("The owner of this guild has been blocked");
},
DispatchError::LackOfPermissions(_) => {
let _ = msg.channel_id.say("You don't have permission to use this command");
},
}
}));All functions prefixed with get_ have had the prefix removed. For example,
Guild::get_webhooks() is now Guild::webhooks().
Instead of using model::permissions::general(), model::permissions::text(),
and model::permissions::voice(), use
model::permissions::{PRESET_GENERAL, PRESET_TEXT, PRESET_VOICE}.
Added
- Add
saymethod toGroup,GuildChannel,PrivateChannel[c:a0bb306] - Add missing
send_file/send_messageimpls [c:bad9ac3] - Add
Message::guild[c:9ef5522] - Add Shard Id helpers c:1561f9e
- Implement
From<&str> for ReactionType[c:e7110ad] - Check for embed lengths on message sends [c:e1079e9]
- Add
is_nsfwcheck to channels [c:9268f9c] - Add missing
Member::kickhelper [c:83b1d96] - Derive
Eq,Hash,PartialEqonReactionType[c:86a4e00] (@acdenisSK)
Fixed
- Handle unsuccessful responses before decoding [c:7e254c5]
- Uniquely ratelimit message deletions c:01f6872
- Fix Member methods due to variant
joined_atvalues [c:cd914f5] - Fix deadlock on channel create event for DMs [c:6b0b9b2] (@sschroe)
- Default to using
[0, 1]shards [c:f0d1157] - Fix ratelimiting for
Route::Noneroutes [c:5bf6c2d] - Fix guild leaving result [c:ae352ea]
- Fix permissions when sending to DMs or groups c:404a089 (@acdenisSK)
- Check if message starts with
dynamic_prefixresult [c:9ec05e7] (@Roughsketch) - Trim content before parsing framework args [c:e6712c9] (@Roughsketch)
Changed
- Optimize caching c:0c9ec37
- Remove most
Contextmethods [c:585af23] - Remove sending message nonces [c:9c04a19]
- Standardize message editing methods c:3c7c575
- Remove invite accepting [c:e4b484f]
- Remove selfbot support [c:d9118c0] [c:c74cc15]
- Switch to using serde for deserialization [c:f6b27eb]
- Update the ways errors are handled in dispatch c:31aae7d (@fwrs)
- Deprecate methods prefixed with
get_c:3f03f9a - Framework help commands now accept a slice of args [c:ff4437a]
- Make
User.discriminatorau16c:0f41ffc - Use constants for preset permissions [c:70d4e75]
Misc.
- Make logo more better [c:6e11a10] (@Flat)
- Fix incorrect cache example [c:b96f85c]
- Rework the models directory [c:9114963]
- Change permission values to byte literals [c:c8536c1]
- Fix example in README [c:d4fc8b6]
rustc nightly fix & optimizations
This is a release to fix broken nightly builds, due to a change in how rustc
handles lifetimes, with a few performance optimizations and other fixes.
Upgrade Path
For Group::send_message, PrivateChannel::send_message,
and GuildChannel::send_message, instead of passing in only a &str of
content, use a CreateMessage builder:
// assuming a `channel` is bound
// old signature:
channel.send_message("hello");
// new signature:
channel.send_message(|m| m.content("hello"));Instead of calling message_id.get_reaction_users and passing in a ChannelId,
call channel_id.get_reaction_users and pass in the MessageId. Note that the
latter already existed.
// assuming `channel_id`, `message_id`, and `reaction_type` are bound
// removed method:
message_id.get_reaction_users(channel_id, reaction_type, Some(10), None);
// alternative method:
channel_id.get_reaction_users(message_id, reaction_type, Some(10), None);Added
- Register the
statususer setting for user accounts (e.g. online, invisible)
c:0b9bf91 - Expose and document ratelimiting structures c:eb09f2d
- Add method to
EditGuildto transfer ownership c:f00e165
Fixed
- Fix potential unreachable pattern warning in
command!macro c:97f9bd1 - Fix value of 'browser' in shard identify c:4cf8338
- Remove lifetime on Search builder c:6f33a35
Changed
Misc.
- Avoid re-requesting the gateway URL when autosharding (optimization)
c:e891ebe - Avoid cloning on non-framework message create events (opt.) c:b7cbf75
- Avoid cloning the context on event dispatches (opt.) c:5ee5fef
- Optimize presence update for current user in cache (opt.) c:9392f61
- Make
GLOBALratelimit mutex a unit (opt.) c:55ccaca - Resume when restarting WS sender/receiver c:04cfaa9
OOP and general stuff
This is a general release for pretty much everything, from new features to
bugfixes to a switch to a more OOP style. The current minimum supported version
is rustc 1.13+.
The next release will be v0.2.0, which will feature serde codegen support along
with a rewrite of the framework. It will be a more modularized version of the
library. v0.2.0 will require rustc 1.15+, due to the stabilization of Macros
1.1.
Thanks to the following for contributions this release:
Two of the major highlights of this release are that the broken pipe issue has
been fixed, and the library is more OOP now and therefore no longer relies on
the Context to get stuff done. The methods feature flag has been removed.
Added
- the
voicefeature no longer requires thecachefeature to be enabled
c:7b45f16 - the
frameworkfeature no longer requires thecachefeature to be enabled
c:86cd00f Guild,InviteGuild, andPartialGuildnow havesplash_urlmethods
c:d58c544- Expose
Message::webhook_idfor messages sent via webhooks (@fwrs)
c:a2cbeb6 - Framework: add option to ignore webhooks or DMs (@fwrs) c:8e2c052
- Added documentation for creating embed timestamps (@foxbot) c:66546d3
- Allow
time::Tmto be passed into the embed timestamp field, in addition to
a direct string c:b001234 - Add
Client::on_message()example (@indiv0) c:bcb70e8 - Support webp/gif avatars/icons in URL methods c:ab778f8
- Update current user presence in cache on set c:5b275fc
- Add
CurrentUser/User::static_avatar_url()methods to generate webp URLs
c:c36841d - Command (batch) alias support (@fwrs) c:f96b6cc
- Command example field for help command (@fwrs) c:f96b6cc
- Added "Meibi Pink" to the
Colourstruct (@hsiW) c:2cb607d - Register support for
4011code (too many shards) (@SunDwarf) c:93f3c60 - Added "Rohrkatze Blue" to the
Colourstruct (@bippum) c:345e140 - Add
User::default_avatar_url()c:e85e901 - Add
Message::content_safe()to avoid@everyone/@heres (@fwrs)
c:e5a83dd - Add
Member::distinct(),User::distinct()(@fwrs) c:e5a83dd - Document that messages can't be older than 14 days when bulk deleting
(@fwrs) c:0a2f5ab - Add shard latency tracking (
stolenborrowed from brayzure/Eris)
c:096b0f5 - Add guild chunking c:3ca7ad9
Fixes
User::avatar_urlno longer mentions the user in the generated URL
c:0708ccf- Framework:
owners_onlycheck now functions only if the author of a message
is an owner (@fwrs) c:6355288 - Framework: fix command cooldown timer (would always say to wait
i64::MAX
seconds) c:fafa363 - Framework: the
beforeclosure is now properly run when a message is sent by
the owner c:760a47a CurrentApplicationInfonow properly decodes due toflagsno longer being
sent c:2a743ce- Fix
Message::delete()permission check c:4229034 - Framework: properly split messages on character boundary limits; aka thanks
Unicode c:c01f238 - Remove need to import Context/Message in command macros (@acdenisSK)
c:abd22d2 - Fix a ton of gateway stuff [c:94fc85b], c:f894cfd, c:f894cfd
- Specify
command!macro signature as returningstd::result::Result
c:e9aae9c - Fix dependency description in example 06 (@DeltaEvo) c:92309b2
- Return a
Userfromrest::get_user-- not aCurrentUserc:f57a187 - Fix shards always booting at index 0 c:83b29d5
- Wait 5 seconds between shard boots to avoid session invalidations c:fb4d411
- Use CDN for default avatars c:69ec62a
- Fix
Resumedevent payload decoding c:c2e8b69 - Fix
CurrentApplicationInfodecoding withoutrpc_originsc:38db32e - Reboot shard on broken pipe; fixes a lot of gateway problems c:76f9095
- Make
rest::execute_webhookbe a POST c:c050c59
Changed
- Framework: argument number is now displayed on parsing error (@fwrs)
c:fb07751 - Id display formatters use the direct u64 instead of mentioning;
format!("{}", UserId(7))will format into"7"instead of"<@7>"
c:933ee89 - Default the framework's
use_quotesfor quote parsing tofalse(wastrue)
c:38a484d - The
CreateEmbedbuilder now has directimageandthumbnailmethods
instead of one-method builders c:68c473d - Accept
u64shard counts to allow using more than 255 shards (instead of
u8s) c:ada07fa - Remove user logout endpoint c:70bf22a
- Don't abuse unicode for message content sanitization (@fwrs) c:2b237e7
- Change
Colourstruct to be a tuplestruct c:a8acd61 - Make a single POST on guild role create c:147cf01
- Switch to a mostly-fully OOP approach c:651c618
- Rename
webhooksmethods toget_webhooks
(eg:GuildChannel::webhooks()-->GuildChannel::get_webhooks())
[c:e8a9086](e8a9086...