diff --git a/src/internal/tokio.rs b/src/internal/tokio.rs index 5c204a27bfb..027c80079c5 100644 --- a/src/internal/tokio.rs +++ b/src/internal/tokio.rs @@ -6,7 +6,10 @@ where F: Future + Send + 'static, T: Send + 'static, { - tokio::task::Builder::new().name(&*format!("serenity::{}", name)).spawn(future) + tokio::task::Builder::new() + .name(&*format!("serenity::{}", name)) + .spawn(future) + .expect("called outside tokio runtime") } #[cfg(not(all(tokio_unstable, feature = "tokio_task_builder")))]