Skip to content

Commit

Permalink
Send the shutdown message earlier in the sample bot example (#984)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcarr authored Oct 1, 2020
1 parent f0cfc0e commit 2d365d0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/e07_sample_bot_structure/src/commands/owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ async fn quit(ctx: &Context, msg: &Message) -> CommandResult {
let data = ctx.data.read().await;

if let Some(manager) = data.get::<ShardManagerContainer>() {
msg.reply(ctx, "Shutting down!").await?;
manager.lock().await.shutdown_all().await;
} else {
msg.reply(ctx, "There was a problem getting the shard manager").await?;

return Ok(());
}

msg.reply(ctx, "Shutting down!").await?;


Ok(())
}

0 comments on commit 2d365d0

Please sign in to comment.