From 3b4e3d85ed95d9c4922dae0e290c029c348cdbd2 Mon Sep 17 00:00:00 2001 From: aurinex Date: Mon, 29 Dec 2025 13:28:36 +0500 Subject: [PATCH] material in prank --- app/models/server/prank.py | 4 +++- app/services/server/prank.py | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/server/prank.py b/app/models/server/prank.py index 6319b96..fe36c3c 100644 --- a/app/models/server/prank.py +++ b/app/models/server/prank.py @@ -5,12 +5,12 @@ class PrankCommandCreate(BaseModel): name: str description: str price: int + material: str command_template: str server_ids: List[str] = Field( default=[], description='Список серверов, где доступна команда. Использование ["*"] означает доступность на всех серверах' ) - material: str targetDescription: Optional[str] = None # Сообщение для целевого игрока globalDescription: Optional[str] = None # Сообщение для всех остальных @@ -18,6 +18,7 @@ class PrankCommandUpdate(BaseModel): name: Optional[str] = None description: Optional[str] = None price: Optional[int] = None + material: Optional[str] = None command_template: Optional[str] = None server_ids: Optional[List[str]] = None targetDescription: Optional[str] = None @@ -29,6 +30,7 @@ class PrankCommand(BaseModel): description: str price: int command_template: str + material: str server_ids: List[str] = [] class PrankExecute(BaseModel): diff --git a/app/services/server/prank.py b/app/services/server/prank.py index 383fa01..1f09ac6 100644 --- a/app/services/server/prank.py +++ b/app/services/server/prank.py @@ -27,6 +27,7 @@ class PrankService: "name": command_data.name, "description": command_data.description, "price": command_data.price, + "material": command_data.get("material"), "command_template": command_data.command_template, "server_ids": command_data.server_ids, "targetDescription": command_data.targetDescription, @@ -49,6 +50,7 @@ class PrankService: "name": cmd["name"], "description": cmd["description"], "price": cmd["price"], + "material": cmd.get("material"), "command_template": cmd["command_template"], "server_ids": cmd.get("server_ids", []), "targetDescription": cmd.get("targetDescription"), @@ -68,6 +70,7 @@ class PrankService: "name": command["name"], "description": command["description"], "price": command["price"], + "material": command.get("material"), "command_template": command["command_template"], "server_ids": command.get("server_ids", []), "targetDescription": command.get("targetDescription"), @@ -88,6 +91,8 @@ class PrankService: update["description"] = update_data.description if update_data.price is not None: update["price"] = update_data.price + if update_data.material is not None: + update["material"] = update_data.material if update_data.command_template is not None: if "{targetPlayer}" not in update_data.command_template: raise HTTPException(status_code=400,