use dyscord; use tokio; use failure::Error; use env_logger; use async_trait::async_trait; use log::info; use std::sync::Arc; struct Handler; #[async_trait] impl dyscord::Handler for Handler { async fn on_connect(self: Arc, _ctx: Arc) { info!("in connect handler"); } async fn on_message_create(self: Arc, _ctx: Arc, _msg: dyscord::Message) { info!("in message handler"); } } #[tokio::main] async fn main() -> Result<(), Error> { env_logger::init(); let client = dyscord::Client::new("", Handler{})?; client.run().await.unwrap(); Ok(()) }