diff options
| author | Zeyla Hellyer <[email protected]> | 2017-06-06 11:25:28 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-06-06 11:25:28 -0700 |
| commit | 799038187d903a75d60f0c98d013ae87fb665d02 (patch) | |
| tree | b0d8ccff9a6e1fc4360a6eebfe5be2335d9936d4 /examples | |
| parent | Add User::direct_message example (diff) | |
| download | serenity-799038187d903a75d60f0c98d013ae87fb665d02.tar.xz serenity-799038187d903a75d60f0c98d013ae87fb665d02.zip | |
Deprecate Client::login, add Client::new
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/01_basic_ping_bot/src/main.rs | 2 | ||||
| -rw-r--r-- | examples/02_transparent_guild_sharding/src/main.rs | 2 | ||||
| -rw-r--r-- | examples/03_struct_utilities/src/main.rs | 2 | ||||
| -rw-r--r-- | examples/04_message_builder/src/main.rs | 2 | ||||
| -rw-r--r-- | examples/05_command_framework/src/main.rs | 2 | ||||
| -rw-r--r-- | examples/06_voice/src/main.rs | 2 | ||||
| -rw-r--r-- | examples/07_sample_bot_structure/src/main.rs | 2 |
7 files changed, 7 insertions, 7 deletions
diff --git a/examples/01_basic_ping_bot/src/main.rs b/examples/01_basic_ping_bot/src/main.rs index 477aea1..25bc52a 100644 --- a/examples/01_basic_ping_bot/src/main.rs +++ b/examples/01_basic_ping_bot/src/main.rs @@ -11,7 +11,7 @@ fn main() { // Create a new instance of the Client, logging in as a bot. This will // automatically prepend your bot token with "Bot ", which is a requirement // by Discord for bot users. - let mut client = Client::login(&token); + let mut client = Client::new(&token); // Set a handler for the `on_message` event - so that whenever a new message // is received - the closure (or function) passed will be called. diff --git a/examples/02_transparent_guild_sharding/src/main.rs b/examples/02_transparent_guild_sharding/src/main.rs index b256cfd..a4f6172 100644 --- a/examples/02_transparent_guild_sharding/src/main.rs +++ b/examples/02_transparent_guild_sharding/src/main.rs @@ -25,7 +25,7 @@ fn main() { // Configure the client with your Discord bot token in the environment. let token = env::var("DISCORD_TOKEN") .expect("Expected a token in the environment"); - let mut client = Client::login(&token); + let mut client = Client::new(&token); client.on_message(|ctx, msg| { if msg.content == "!ping" { diff --git a/examples/03_struct_utilities/src/main.rs b/examples/03_struct_utilities/src/main.rs index 455d006..8802fba 100644 --- a/examples/03_struct_utilities/src/main.rs +++ b/examples/03_struct_utilities/src/main.rs @@ -7,7 +7,7 @@ fn main() { // Configure the client with your Discord bot token in the environment. let token = env::var("DISCORD_TOKEN") .expect("Expected a token in the environment"); - let mut client = Client::login(&token); + let mut client = Client::new(&token); client.on_message(|_ctx, msg| { if msg.content == "!messageme" { diff --git a/examples/04_message_builder/src/main.rs b/examples/04_message_builder/src/main.rs index 54f3b79..e82d6b9 100644 --- a/examples/04_message_builder/src/main.rs +++ b/examples/04_message_builder/src/main.rs @@ -8,7 +8,7 @@ fn main() { // Configure the client with your Discord bot token in the environment. let token = env::var("DISCORD_TOKEN") .expect("Expected a token in the environment"); - let mut client = Client::login(&token); + let mut client = Client::new(&token); client.on_message(|_ctx, msg| { if msg.content == "!ping" { diff --git a/examples/05_command_framework/src/main.rs b/examples/05_command_framework/src/main.rs index c8abb9d..4d5ead4 100644 --- a/examples/05_command_framework/src/main.rs +++ b/examples/05_command_framework/src/main.rs @@ -32,7 +32,7 @@ fn main() { // Configure the client with your Discord bot token in the environment. let token = env::var("DISCORD_TOKEN") .expect("Expected a token in the environment"); - let mut client = Client::login(&token); + let mut client = Client::new(&token); { let mut data = client.data.lock().unwrap(); diff --git a/examples/06_voice/src/main.rs b/examples/06_voice/src/main.rs index 6bc7fb5..5236376 100644 --- a/examples/06_voice/src/main.rs +++ b/examples/06_voice/src/main.rs @@ -20,7 +20,7 @@ fn main() { // Configure the client with your Discord bot token in the environment. let token = env::var("DISCORD_TOKEN") .expect("Expected a token in the environment"); - let mut client = Client::login(&token); + let mut client = Client::new(&token); client.with_framework(|f| f .configure(|c| c diff --git a/examples/07_sample_bot_structure/src/main.rs b/examples/07_sample_bot_structure/src/main.rs index 85600eb..42ccd64 100644 --- a/examples/07_sample_bot_structure/src/main.rs +++ b/examples/07_sample_bot_structure/src/main.rs @@ -18,7 +18,7 @@ use serenity::Client; use std::env; fn main() { - let mut client = Client::login(&env::var("DISCORD_TOKEN").unwrap()); + let mut client = Client::new(&env::var("DISCORD_TOKEN").unwrap()); client.with_framework(|f| f .configure(|c| c.prefix("~")) |