diff options
| author | Zeyla Hellyer <[email protected]> | 2017-04-05 08:14:43 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-04-05 08:55:01 -0700 |
| commit | d9118c081742d6654dc0a4f60228a7a212ca436e (patch) | |
| tree | 003f49f54769314c1111e942d77f57513406fb5e /src/ext/framework | |
| parent | Add a sample bot structure example (diff) | |
| download | serenity-d9118c081742d6654dc0a4f60228a7a212ca436e.tar.xz serenity-d9118c081742d6654dc0a4f60228a7a212ca436e.zip | |
Remove selfbot support
While selfbots have always been "roughly tolerated", lately they have
been tolerated to less of a degree.
The simple answer is to no longer support selfbots in any form. This is
done for a few of reasons: 1) in anticipation of selfbots no longer
being tolerated; 2) there are few reasons why one should make a selfbot
in Rust and not a scripting language; 3) there are alternatives
(i.e. discord-rs) that still support userbots. Selfbots are simply not
a goal of the maintainer of serenity.
Upgrade path:
Don't use selfbots with serenity. Use discord-rs instead.
The following has been removed:
Enums:
- `RelationshipType`
Structs:
- `FriendSourceFlags`
- `ReadState`
- `Relationship`
- `SearchResult`
- `SuggestionReason`
- `Tutorial`
- `UserConnection`
- `UserGuildSettings`
- `UserSettings`
Removed the following fields:
- `CurrentUser::mobile`
- Ready::{
analytics_token,
experiments,
friend_suggestion_count,
notes,
read_state,
relationships,
tutorial,
user_guild_settings,
user_settings,
}
Removed the following methods:
- `Client::login_user`
Deprecated `Client::login_bot` in favour of `Client::login`.
Removed `client::LoginType`.
The following no longer take a `login_type` parameter:
- `Context::new`
- `Shard::new`
`Shard::sync_guilds` has been removed.
The `client::Error::{InvalidOperationAsBot, InvalidOperationAsUser}`
variants have been removed.
The following event handlers on `Client` have been removed:
- `on_friend_suggestion_create`
- `on_friend_suggestion_delete`
- `on_relationship_add`
- `on_relationship_remove`
- `on_user_guild_settings_update`
- `on_note_update`
- `on_user_settings_update`
The following `client::rest` functions have been removed:
- `ack_message`
- `edit_note`
- `get_user_connections`
- `search_channel_messages`
- `search_guild_messages`
The following `client::rest::ratelimiting::Route` variants have been
removed:
- `ChannelsIdMessagesSearch`
- `GuildsIdMessagesSearch`
- `UsersMeConnections`
The following fields on `ext::cache::Cache` have been removed:
- `guild_settings`
- `relationships`
- `settings`
while the following methods have also been removed:
- `update_with_relationship_add`
- `update_with_relationship_remove`
- `update_with_user_guild_settings_update`
- `update_with_user_note_update`
- `update_with_user_settings_update`
The following methods have been removed across models:
- `ChannelId::{ack, search}`
- `Channel::{ack, search}`
- `Group::{ack, search}`
- `GuildChannel::{ack, search}`
- `GuildId::{search, search_channels}`
- `Guild::{search, search_channels}`
- `Message::ack`
- `PartialGuild::{search, search_channels}`
- `PrivateChannel::{ack, search}`
- `UserId::{delete_note, edit_note}`
- `User::{delete_note, edit_note}`
The following events in `model::events` have been removed:
- `FriendSuggestionCreateEvent`
- `FriendSuggestionDeleteEvent`
- `MessageAckEvent`
- `RelationshipAddEvent`
- `RelationshipRemoveEvent`
- `UserGuildSettingsUpdateEvent`
- `UserNoteUpdateEvent`
- `UserSettingsUpdateEvent`
Consequently, the following variants on `model::event::Event` have been
removed:
- `FriendSuggestionCreate`
- `FriendSuggestionDelete`
- `MessageAdd`
- `RelationshipAdd`
- `RelationshipRemove`
- `UserGuildSettingUpdate`
- `UserNoteUpdate`
- `UserSettingsUpdate`
The `utils::builder::Search` search builder has been removed.
Diffstat (limited to 'src/ext/framework')
| -rw-r--r-- | src/ext/framework/configuration.rs | 2 | ||||
| -rw-r--r-- | src/ext/framework/create_command.rs | 2 | ||||
| -rw-r--r-- | src/ext/framework/help_commands.rs | 2 | ||||
| -rw-r--r-- | src/ext/framework/mod.rs | 10 |
4 files changed, 9 insertions, 7 deletions
diff --git a/src/ext/framework/configuration.rs b/src/ext/framework/configuration.rs index 0fd18c2..b5c58c9 100644 --- a/src/ext/framework/configuration.rs +++ b/src/ext/framework/configuration.rs @@ -41,7 +41,7 @@ pub enum AccountType { /// use serenity::Client; /// use std::env; /// -/// let mut client = Client::login_bot(&env::var("DISCORD_BOT_TOKEN").unwrap()); +/// let mut client = Client::login(&env::var("DISCORD_BOT_TOKEN").unwrap()); /// /// client.with_framework(|f| f /// .configure(|c| c.on_mention(true).prefix("~"))); diff --git a/src/ext/framework/create_command.rs b/src/ext/framework/create_command.rs index 68319af..7f2c25f 100644 --- a/src/ext/framework/create_command.rs +++ b/src/ext/framework/create_command.rs @@ -45,7 +45,7 @@ impl CreateCommand { /// use serenity::model::Message; /// use std::env; /// - /// let mut client = Client::login_bot(&env::var("DISCORD_TOKEN").unwrap()); + /// let mut client = Client::login(&env::var("DISCORD_TOKEN").unwrap()); /// /// client.with_framework(|f| f /// .configure(|c| c.prefix("~")) diff --git a/src/ext/framework/help_commands.rs b/src/ext/framework/help_commands.rs index 4f16773..cee0e5e 100644 --- a/src/ext/framework/help_commands.rs +++ b/src/ext/framework/help_commands.rs @@ -10,7 +10,7 @@ //! use serenity::Client; //! use std::env; //! -//! let mut client = Client::login_bot(&env::var("DISCORD_TOKEN").unwrap()); +//! let mut client = Client::login(&env::var("DISCORD_TOKEN").unwrap()); //! client.with_framework(|f| f //! .command("help", |c| c.exec_help(help_commands::with_embeds))); //! ``` diff --git a/src/ext/framework/mod.rs b/src/ext/framework/mod.rs index 552ab93..098f26a 100644 --- a/src/ext/framework/mod.rs +++ b/src/ext/framework/mod.rs @@ -36,7 +36,7 @@ //! use serenity::model::Message; //! use std::env; //! -//! let mut client = Client::login_bot(&env::var("DISCORD_BOT_TOKEN").unwrap()); +//! let mut client = Client::login(&env::var("DISCORD_BOT_TOKEN").unwrap()); //! //! client.with_framework(|f| f //! .configure(|c| c.prefix("~")) @@ -74,11 +74,13 @@ use std::default::Default; use std::sync::Arc; use std::thread; use ::client::Context; -use ::model::{Channel, Message, UserId}; +use ::model::{Message, UserId}; use ::utils; #[cfg(feature="cache")] use ::client::CACHE; +#[cfg(feature="cache")] +use ::model::Channel; /// A macro to generate "named parameters". This is useful to avoid manually /// using the "arguments" parameter and manually parsing types. @@ -214,7 +216,7 @@ impl Framework { /// use serenity::Client; /// use std::env; /// - /// let mut client = Client::login_bot(&env::var("DISCORD_TOKEN").unwrap()); + /// let mut client = Client::login(&env::var("DISCORD_TOKEN").unwrap()); /// client.with_framework(|f| f /// .configure(|c| c /// .depth(3) @@ -696,7 +698,7 @@ impl Framework { /// use serenity::model::Message; /// use std::env; /// - /// let mut client = Client::login_bot(&env::var("DISCORD_TOKEN").unwrap()); + /// let mut client = Client::login(&env::var("DISCORD_TOKEN").unwrap()); /// /// client.with_framework(|f| f /// .configure(|c| c.prefix("~")) |