feat: add dms, hieracthical arguments, permission and rank system

This commit is contained in:
Soph :3 2025-09-14 14:59:16 +03:00
parent 544bbf73cb
commit 257bc55b75
25 changed files with 503 additions and 209 deletions

View file

@ -272,6 +272,7 @@ impl Command for FarmCommand {
arg_type: ArgumentType::Enum(&["sell", "all", "harvest"]),
required: false,
default: None,
children: &[],
}]
}
@ -384,14 +385,7 @@ impl Command for FarmCommand {
}
async fn event(&mut self, _: Client, _: ClientEvent) {}
async fn execute(&mut self, client: Client, player: Player, args: ParsedArguments) {
let mut user = sqlx::query_as::<_, User>("SELECT * FROM users WHERE _id = $1")
.bind(&player._id)
.fetch_optional(self.pool.as_ref())
.await
.unwrap()
.unwrap();
async fn execute(&mut self, client: Client, _: Player, args: ParsedArguments, mut user: User) {
let command = match args.get("action") {
Some(ParsedArgument::Enum(s)) => s.as_str(),
_ => "",