From 5827a2e98a847689c198ddce602574ce7e724339 Mon Sep 17 00:00:00 2001 From: Paillat Date: Thu, 13 Mar 2025 14:11:59 +0100 Subject: [PATCH] :sparkles: Add path_prefix parameter to constructor for customizable router prefix (#13) --- src/pycord_rest/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pycord_rest/app.py b/src/pycord_rest/app.py index 2507d32..3893415 100644 --- a/src/pycord_rest/app.py +++ b/src/pycord_rest/app.py @@ -57,10 +57,10 @@ class App(discord.Bot): _FastAPI: type[FastAPI] = FastAPI _APIRouter: type[APIRouter] = APIRouter - def __init__(self, *args: Any, **options: Any) -> None: # pyright: ignore [reportExplicitAny] + def __init__(self, *args: Any, path_prefix: str = "", **options: Any) -> None: # pyright: ignore [reportExplicitAny] super().__init__(*args, **options) # pyright: ignore [reportUnknownMemberType] self._app: FastAPI = self._FastAPI(openapi_url=None, docs_url=None, redoc_url=None) - self.router: APIRouter = self._APIRouter() + self.router: APIRouter = self._APIRouter(prefix=path_prefix) self._public_key: str | None = None @property