parralellllll start
This commit is contained in:
parent
8988bbd180
commit
f8ec903a2c
11
src/main.rs
11
src/main.rs
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue