diff options
author | gennyble <gen@nyble.dev> | 2025-08-14 23:17:13 -0500 |
---|---|---|
committer | gennyble <gen@nyble.dev> | 2025-08-14 23:17:13 -0500 |
commit | d997d8a3d640cf36b0e705db249e1a8865f0b54f (patch) | |
tree | e1478fd88f515755fa0fd1db98ff4f7c31d4b815 /src/command/mod.rs | |
parent | 2e56bb762c4a521efd57d1c51796e9f096a7cfe0 (diff) | |
download | leaberblord-d997d8a3d640cf36b0e705db249e1a8865f0b54f.tar.gz leaberblord-d997d8a3d640cf36b0e705db249e1a8865f0b54f.zip |
slightly scuffed revise command
Diffstat (limited to 'src/command/mod.rs')
-rw-r--r-- | src/command/mod.rs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/command/mod.rs b/src/command/mod.rs index 165cdb6..73b292a 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -1,8 +1,10 @@ mod add_points; mod leaderboard; +mod revise; pub use add_points::add_points; pub use leaderboard::leaderboard; +pub use revise::revise; use std::sync::Arc; @@ -27,6 +29,7 @@ pub enum Commands { About, Leaderboard, Points, + Revise, Permission, Import, } @@ -43,6 +46,7 @@ pub async fn handler( Commands::About => about(brain.clone(), guild), Commands::Leaderboard => leaderboard(brain.clone(), guild, Some(command_data)), Commands::Points => add_points(brain.clone(), guild, create, command_data).await, + Commands::Revise => revise(brain.clone(), guild, create, command_data).await, Commands::Permission => permission(brain.clone(), guild, create, command_data).await, Commands::Import => { import(brain.clone(), guild, create, command_data).await; @@ -82,6 +86,24 @@ pub async fn build() -> Vec<Command> { .unwrap() .build(); + let revise = CommandBuilder::new( + "revise", + "Change history by adding/removing points at a specific point in time", + CommandType::ChatInput, + ) + .option(IntegerBuilder::new("points", "number of points. - or +").required(true)) + .option(StringBuilder::new("users", "mention people to modify their points!!").required(true)) + .option( + StringBuilder::new( + "date", + "Date string in the YYYY-DD-MM format, with optional time component (HH:MM:SS, 24-hour time)", + ) + .required(true), + ) + .validate() + .unwrap() + .build(); + let permission = CommandBuilder::new( "permission", "set who is allowed to change points", @@ -104,7 +126,7 @@ pub async fn build() -> Vec<Command> { ) .build(); - vec![about, leaderboard, points, permission, import] + vec![about, leaderboard, points, revise, permission, import] } pub fn about(_brain: Arc<Brain>, _guild: Id<GuildMarker>) -> InteractionResponseData { |