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() {
println!("hello there");
// Create a separate Tokio runtime for the bot
let bot_runtime = Runtime::new().unwrap();
let bot_handle = bot_runtime.handle().clone();
// Spawn the bot task onto the separate runtime
bot_handle.spawn(async move {
bot::start_discord_bot().await;
let handle = thread::spawn(|| {
println!("general kenobi");
let mut rt = Runtime::new().unwrap();
rt.block_on(bot::start_discord_bot());
});
// Run the GUI on the main thread