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 Timespec
s 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_safe
methods 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
Content
forMessageBuilder
(@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
wait
parameter tohttp::execute_webhook
c:dc73d1a
Fixed
- Don't skip
@everyone
role when checking channel overwrites (@Roughsketch)
c:b468cbf - Allow
unreachable_code
lint incommand!
macro (@Flat) c:eb43b9c - Fix incorrect attempted
send_file
deserialization 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_permission
to take a reference c:aea9885 - Remove deprecated
GuildChannel
methods c:ab7f113 Guild::create_channel
doesn'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::dm
accept a builder c:11a02db - Deprecate
Client::login
, addClient::new
c:7990381 - Make
Member::guild_id
non-optional c:b4bd771 - Remove
Context::channel_id
andContext::queue
c:8b504ad - Make the framework's
dynamic_prefix
accept an&Message
c:2845681 - Deprecate
Channel::delete_messages
,Channel::delete_permission
c:7fc49d8 - Make
Message::nonce
aserde_json::Value
c:c832009
Misc.
- Remove deprecated
login_bot
usage from docs (@hsiW) c:ae395f4 - Fix call to
VoiceManager::join
in example 06 (@barzamin) c:6853daf - Sort default help by group/command names (@Roughsketch) c:93416cd
- Move
CreateGroup
docs 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
cookie
dependency 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