diff --git a/src/commands/eco/fish.rs b/src/commands/eco/fish.rs index cd8d0d5..512b95a 100644 --- a/src/commands/eco/fish.rs +++ b/src/commands/eco/fish.rs @@ -182,7 +182,7 @@ impl Command for FishCommand { fn argument_spec(&self) -> &'static [ArgumentSpec] { &[ArgumentSpec { name: "action", - arg_type: ArgumentType::String, + arg_type: ArgumentType::Enum(&["sell"]), required: false, default: None, children: &[], @@ -198,7 +198,7 @@ impl Command for FishCommand { mut user: User, ) { let action = match args.get("action") { - Some(ParsedArgument::String(s)) => s.as_str(), + Some(ParsedArgument::Enum(s)) => s.as_str(), _ => "", }; diff --git a/src/commands/eco/shop.rs b/src/commands/eco/shop.rs index 3bb449a..5747b1c 100644 --- a/src/commands/eco/shop.rs +++ b/src/commands/eco/shop.rs @@ -111,12 +111,23 @@ impl Command for ShopCommand { async fn constructed(&mut self, _: Client) {} async fn event(&mut self, _: Client, _: ClientEvent) {} - fn argument_spec(&self) -> &'static [ArgumentSpec] { + // Static array of item IDs from SHOP_ITEMS + // This is safe because SHOP_ITEMS is 'static &[ ArgumentSpec { name: "item_id", - arg_type: ArgumentType::String, + arg_type: ArgumentType::Enum(&[ + SHOP_ITEMS[0].id, + SHOP_ITEMS[1].id, + SHOP_ITEMS[2].id, + SHOP_ITEMS[3].id, + SHOP_ITEMS[4].id, + SHOP_ITEMS[5].id, + SHOP_ITEMS[6].id, + SHOP_ITEMS[7].id, + SHOP_ITEMS[8].id, + ]), required: false, default: None, children: &[],