diff --git a/src/io.rs b/src/io.rs index 59091a3..e157039 100644 --- a/src/io.rs +++ b/src/io.rs @@ -55,8 +55,6 @@ pub struct VoteContainer { pub(crate) group: Option, /// Optional hours describing the specific date of the event pub(crate) hours: Option, - /// Short name, used in voting titles - pub(crate) short_name: Option, /// Auto-Start date of the event (in human-readable format) pub(crate) start_date: Option, /// Days not selected for the vote @@ -121,21 +119,19 @@ pub(crate) struct WeeklyVoteModal { #[name = "Groupe"] #[placeholder = "groupe (sans le @)"] group: Option, - /// The time a which the event shall take place - #[name = "Horaires"] - #[placeholder = "'21h - 23h' par défaut"] - hours: Option, - /// The name of the event - #[name = "Nom du jeu"] - #[placeholder = "'FFXIV', 'MHW', 'D&D'..."] - short_name: Option, + /// The date from which the vote can become active + #[name = "Date de début du vote"] + #[placeholder = "'ven', '10', '21 jan', vide pour la prochaine période de votes"] + start_date: Option, + /// Days for which reactions should "not count" + #[name = "Jours non dispos"] + #[placeholder = "'lun', '30', '2 dec'"] + non_days: Option, // Max fields is 5 so the two below will have to be command-exclusive - // #[name = "Date de début du vote"] - // #[placeholder = "'ven', '10', '21 jan', vide pour la prochaine période de votes"] - // start_date: Option, - // #[name = "Jours non dispos"] - // #[placeholder = "'lun', '30', '2 dec'"] - // non_days: Option, + // /// The time a which the event shall take place + // #[name = "Horaires"] + // #[placeholder = "'21h - 23h' par défaut"] + // hours: Option, } #[cfg(test)] // This default implementation only exists during testing @@ -198,7 +194,6 @@ pub async fn vote_modal( description: underlying_data.description, group, hours: underlying_data.hours, - short_name: underlying_data.short_name, identifier: VoteTypeIdentifier::WeeklyVote, ..Default::default() }; @@ -263,7 +258,6 @@ fn find_role_from_str(group: Option<&str>, roles: Vec<&str>) -> Option { pub async fn vote_command( ctx: Context<'_>, #[description = "Titre"] title: String, - #[description = "Nom du jeu"] short_name: Option, #[description = "Groupe"] group: Option, #[description = "Description"] description: String, #[description = "Horaires"] hours: Option, @@ -275,7 +269,6 @@ pub async fn vote_command( description, group, hours, - short_name, start_date, non_days, identifier: VoteTypeIdentifier::WeeklyVote, diff --git a/src/main.rs b/src/main.rs index 5d6f8de..e1b214b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ async fn main() { init_logger().unwrap(); // TODO: Check that this is actually what we want task::spawn(main_scheduler_loop( - time::interval(time::Duration::from_secs(1)), + time::interval(time::Duration::from_secs(5)), event_context.clone(), )); discord_main_loop(event_context).await; diff --git a/src/watchdog.rs b/src/watchdog.rs index 45b9b2e..3163b99 100644 --- a/src/watchdog.rs +++ b/src/watchdog.rs @@ -15,6 +15,8 @@ use crate::votes::EventHolder; use chrono::{DateTime, Local, NaiveDate}; +use poise::serenity_prelude::{CacheHttp, ChannelId}; +use serde::Serialize; /// The main scheduler waiting and dispatch loop. /// @@ -40,9 +42,17 @@ fn fk_around(ev_ctx: &EventHolder) { "In the fk_around function ({}):", Local::now() // &ev_ctx ); - if let Some(discord_ctx) = ev_ctx.discord_ctx.lock().unwrap().as_mut() { - println!("Fking around : {:#?}", discord_ctx); - } + // if let Some(discord_ctx) = ev_ctx.discord_ctx.lock().unwrap().as_mut() { + // println!("Fking around : {:#?}", discord_ctx); + // let _ = discord_ctx + // .http() + // .send_message( + // ChannelId::new(1300786300143800351), + // Vec::new(), + // &"This is a message".to_owned(), + // ) + // .await; + // } } /// The `watchdog_update` function updates the state of the watchdog and executes the necessary tasks.