6 Commits

Author SHA1 Message Date
e971ba5f19 ⬆️ Update py-cord dependency to allow for newer versions (#18) 2025-04-17 00:52:16 +02:00
fd45c0305e 📌 Update py-cord dependency to allow for newer versions (#17) 2025-04-17 00:40:12 +02:00
pre-commit-ci[bot]
57c6a3c4cd 👷 pre-commit autoupdate (#3)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Paillat <me@paillat.dev>
2025-04-15 22:04:51 +02:00
renovate[bot]
013e4aba14 ⬆️: migrate renovate config (#15)
* ⬆️: migrate config renovate.json

* 🎨 auto fixes from pre-commit.com hooks

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-03-24 17:14:14 +01:00
124ce383bb Disable uvicorn server_header (#14) 2025-03-17 08:28:17 +01:00
5827a2e98a Add path_prefix parameter to constructor for customizable router prefix (#13) 2025-03-13 14:11:59 +01:00
5 changed files with 9 additions and 8 deletions

View File

@@ -21,7 +21,7 @@ repos:
exclude: \.(po|pot|yml|yaml)$
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.10
rev: v0.11.5
hooks:
# Run the linter.
- id: ruff

View File

@@ -24,7 +24,7 @@ keywords = ["discord", "bot", "rest", "pycord"]
dependencies = [
"fastapi>=0.115.11",
"orjson>=3.10.15",
"py-cord==2.6.1",
"py-cord>=2.6.1",
"pynacl>=1.5.0",
"uvicorn>=0.34.0",
]

View File

@@ -8,12 +8,12 @@
"commitMessageAction": "Upgrade",
"packageRules": [
{
"updateTypes": ["pin"],
"matchUpdateTypes": ["pin"],
"commitMessagePrefix": "📌",
"commitMessageAction": "Pin"
},
{
"updateTypes": ["rollback"],
"matchUpdateTypes": ["rollback"],
"commitMessagePrefix": "⬇️",
"commitMessageAction": "Downgrade"
},

View File

@@ -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
@@ -267,6 +267,7 @@ class App(discord.Bot):
self._app.include_router(self.router)
uvicorn_options = uvicorn_options or {}
uvicorn_options["log_level"] = uvicorn_options.get("log_level", logging.root.level)
uvicorn_options["server_header"] = uvicorn_options.get("server_header", False)
config = self._UvicornConfig(self._app, **uvicorn_options)
server = self._UvicornServer(config)
try:

2
uv.lock generated
View File

@@ -319,7 +319,7 @@ dev = [
requires-dist = [
{ name = "fastapi", specifier = ">=0.115.11" },
{ name = "orjson", specifier = ">=3.10.15" },
{ name = "py-cord", specifier = "==2.6.1" },
{ name = "py-cord", specifier = ">=2.6.1" },
{ name = "pynacl", specifier = ">=1.5.0" },
{ name = "uvicorn", specifier = ">=0.34.0" },
]