feat!: implemented answer buttons
- Also you can /init without restarting bot BREAKING CHANGE: Changed type of Data::discord to Arc<Mutex<DiscordConfig>, removed field pending_answers from DiscordConfig
This commit is contained in:
parent
3f7e6313b0
commit
1ae57ad358
4 changed files with 70 additions and 23 deletions
|
|
@ -1,3 +1,5 @@
|
|||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use clap::Parser;
|
||||
use dotenvy::dotenv;
|
||||
use poise::serenity_prelude as serenity;
|
||||
|
|
@ -11,7 +13,7 @@ mod config;
|
|||
|
||||
struct Data {
|
||||
pub config: Config,
|
||||
pub discord: DiscordConfig,
|
||||
pub discord: Arc<Mutex<DiscordConfig>>,
|
||||
}
|
||||
type Error = Box<dyn std::error::Error + Send + Sync>;
|
||||
type Context<'a> = poise::Context<'a, Data, Error>;
|
||||
|
|
@ -45,7 +47,7 @@ async fn main() {
|
|||
poise::builtins::register_globally(ctx, &framework.options().commands).await?;
|
||||
Ok(Data {
|
||||
config,
|
||||
discord,
|
||||
discord: Arc::new(Mutex::new(discord)),
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue