aboutsummaryrefslogtreecommitdiff
path: root/examples/05_user_login/src/main.rs
blob: bbc9303827b476baee77673a190d710fa82e0b67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate serenity;

use serenity::Client;
use std::env;

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_user(&token);

    client.on_ready(|_context, ready| {
        println!("{} is connected!", ready.user.name);
    });

    println!("{:?}", client.start());
}