Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created March 23, 2020 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BetterProgramming/123bfdb6ff6adf4a750cf83026d615f8 to your computer and use it in GitHub Desktop.
Save BetterProgramming/123bfdb6ff6adf4a750cf83026d615f8 to your computer and use it in GitHub Desktop.
//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