Move standard startup to externally pokable method
This commit is contained in:
parent
819feef76b
commit
b1d0927ff0
|
|
@ -20,11 +20,8 @@ impl Handler {
|
||||||
timer_running: AtomicBool::from(false)
|
timer_running: AtomicBool::from(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
pub async fn standard_startup(ctx: Context, data_about_bot: Ready) {
|
||||||
impl EventHandler for Handler {
|
|
||||||
async fn ready(&self, ctx: Context, data_about_bot: Ready) {
|
|
||||||
let data = ctx.data.read().await;
|
let data = ctx.data.read().await;
|
||||||
let config = match data.get::<ManifoldConfig>() {
|
let config = match data.get::<ManifoldConfig>() {
|
||||||
Some(c) => c.lock().await,
|
Some(c) => c.lock().await,
|
||||||
|
|
@ -55,3 +52,10 @@ impl EventHandler for Handler {
|
||||||
channel.say(&ctx, greeting).await.expect("Couldn't message log channel!");
|
channel.say(&ctx, greeting).await.expect("Couldn't message log channel!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
|
impl EventHandler for Handler {
|
||||||
|
async fn ready(&self, ctx: Context, data_about_bot: Ready) {
|
||||||
|
Handler::standard_startup(ctx, data_about_bot).await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue