Reworked voting options and in particular modals

This commit is contained in:
Vicky 2024-11-29 11:22:41 +01:00 committed by Dandaedre
parent 4609d910da
commit 954f6a663b
1 changed files with 12 additions and 19 deletions

View File

@ -55,8 +55,6 @@ pub struct VoteContainer {
pub(crate) group: Option<serenity::RoleId>,
/// Optional hours describing the specific date of the event
pub(crate) hours: Option<String>,
/// Short name, used in voting titles
pub(crate) short_name: Option<String>,
/// Auto-Start date of the event (in human-readable format)
pub(crate) start_date: Option<String>,
/// Days not selected for the vote
@ -121,21 +119,19 @@ pub(crate) struct WeeklyVoteModal {
#[name = "Groupe"]
#[placeholder = "groupe (sans le @)"]
group: Option<String>,
/// The time a which the event shall take place
#[name = "Horaires"]
#[placeholder = "'21h - 23h' par défaut"]
hours: Option<String>,
/// The name of the event
#[name = "Nom du jeu"]
#[placeholder = "'FFXIV', 'MHW', 'D&D'..."]
short_name: Option<String>,
/// 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<String>,
/// Days for which reactions should "not count"
#[name = "Jours non dispos"]
#[placeholder = "'lun', '30', '2 dec'"]
non_days: Option<String>,
// 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<String>,
// #[name = "Jours non dispos"]
// #[placeholder = "'lun', '30', '2 dec'"]
// non_days: Option<String>,
// /// The time a which the event shall take place
// #[name = "Horaires"]
// #[placeholder = "'21h - 23h' par défaut"]
// hours: Option<String>,
}
#[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<String> {
pub async fn vote_command(
ctx: Context<'_>,
#[description = "Titre"] title: String,
#[description = "Nom du jeu"] short_name: Option<String>,
#[description = "Groupe"] group: Option<serenity::RoleId>,
#[description = "Description"] description: String,
#[description = "Horaires"] hours: Option<String>,
@ -275,7 +269,6 @@ pub async fn vote_command(
description,
group,
hours,
short_name,
start_date,
non_days,
identifier: VoteTypeIdentifier::WeeklyVote,