Created
March 23, 2020 14:50
-
-
Save BetterProgramming/123bfdb6ff6adf4a750cf83026d615f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in src/main.rs | |
pub mod config; | |
use config::Config; | |
use serenity::{ | |
prelude::*, | |
model::prelude::*, | |
Client, | |
}; | |
struct Handler; | |
impl EventHandler for Handler { | |
fn message(&self, context: Context, msg: Message) { | |
unimplemented!(); | |
} | |
} | |
fn main() { | |
let _ = Config::new().save(); | |
let config = Config::load().unwrap(); | |
let mut client = Client::new(config.token(), Handler) | |
.expect("Couldn't create the new client!"); | |
if let Err(why) = client.start() { | |
println!("Client error: {}", why) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment