parralellllll start

This commit is contained in:
WanderingPenwing 2024-03-08 08:11:28 +01:00
parent 8988bbd180
commit f8ec903a2c

View file

@ -10,13 +10,10 @@ const MAX_FPS: f32 = 30.0;
fn main() { fn main() {
println!("hello there"); println!("hello there");
// Create a separate Tokio runtime for the bot let handle = thread::spawn(|| {
let bot_runtime = Runtime::new().unwrap(); println!("general kenobi");
let bot_handle = bot_runtime.handle().clone(); let mut rt = Runtime::new().unwrap();
rt.block_on(bot::start_discord_bot());
// Spawn the bot task onto the separate runtime
bot_handle.spawn(async move {
bot::start_discord_bot().await;
}); });
// Run the GUI on the main thread // Run the GUI on the main thread