mirror of
https://github.com/Paillat-dev/pycord-rest.git
synced 2026-01-02 09:06:20 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99a516b0f0 | ||
|
|
c356d0f74d | ||
|
|
8394b56afe | ||
| e971ba5f19 | |||
| fd45c0305e | |||
|
|
57c6a3c4cd | ||
|
|
013e4aba14 | ||
| 124ce383bb | |||
| 5827a2e98a |
2
.github/workflows/publish.yaml
vendored
2
.github/workflows/publish.yaml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: "Install uv"
|
- name: "Install uv"
|
||||||
uses: astral-sh/setup-uv@v5
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/quality.yaml
vendored
2
.github/workflows/quality.yaml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: "Install uv"
|
- name: "Install uv"
|
||||||
uses: astral-sh/setup-uv@v5
|
uses: astral-sh/setup-uv@v6
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ repos:
|
|||||||
exclude: \.(po|pot|yml|yaml)$
|
exclude: \.(po|pot|yml|yaml)$
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
# Ruff version.
|
# Ruff version.
|
||||||
rev: v0.9.10
|
rev: v0.11.11
|
||||||
hooks:
|
hooks:
|
||||||
# Run the linter.
|
# Run the linter.
|
||||||
- id: ruff
|
- id: ruff
|
||||||
@@ -31,4 +31,4 @@ repos:
|
|||||||
- repo: https://github.com/bhundven/copywrite # waiting for https://github.com/hashicorp/copywrite/pull/120 to be merged
|
- repo: https://github.com/bhundven/copywrite # waiting for https://github.com/hashicorp/copywrite/pull/120 to be merged
|
||||||
rev: 937f17f09c46992447dfa8977bb96eda512588c4
|
rev: 937f17f09c46992447dfa8977bb96eda512588c4
|
||||||
hooks:
|
hooks:
|
||||||
- id: add-headers
|
- id: add-headers
|
||||||
|
|||||||
@@ -63,13 +63,9 @@ Built on:
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install pycord-rest-bot --prerelease=allow
|
pip install pycord-rest-bot
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- prettier-ignore -->
|
|
||||||
> [!NOTE]
|
|
||||||
> The package is currently in pre-release.
|
|
||||||
|
|
||||||
<!-- quick-start -->
|
<!-- quick-start -->
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ keywords = ["discord", "bot", "rest", "pycord"]
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"fastapi>=0.115.11",
|
"fastapi>=0.115.11",
|
||||||
"orjson>=3.10.15",
|
"orjson>=3.10.15",
|
||||||
"py-cord==2.6.1",
|
"py-cord>=2.6.1",
|
||||||
"pynacl>=1.5.0",
|
"pynacl>=1.5.0",
|
||||||
"uvicorn>=0.34.0",
|
"uvicorn>=0.34.0",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
"commitMessageAction": "Upgrade",
|
"commitMessageAction": "Upgrade",
|
||||||
"packageRules": [
|
"packageRules": [
|
||||||
{
|
{
|
||||||
"updateTypes": ["pin"],
|
"matchUpdateTypes": ["pin"],
|
||||||
"commitMessagePrefix": "📌",
|
"commitMessagePrefix": "📌",
|
||||||
"commitMessageAction": "Pin"
|
"commitMessageAction": "Pin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"updateTypes": ["rollback"],
|
"matchUpdateTypes": ["rollback"],
|
||||||
"commitMessagePrefix": "⬇️",
|
"commitMessagePrefix": "⬇️",
|
||||||
"commitMessageAction": "Downgrade"
|
"commitMessageAction": "Downgrade"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ class App(discord.Bot):
|
|||||||
_FastAPI: type[FastAPI] = FastAPI
|
_FastAPI: type[FastAPI] = FastAPI
|
||||||
_APIRouter: type[APIRouter] = APIRouter
|
_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]
|
super().__init__(*args, **options) # pyright: ignore [reportUnknownMemberType]
|
||||||
self._app: FastAPI = self._FastAPI(openapi_url=None, docs_url=None, redoc_url=None)
|
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
|
self._public_key: str | None = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -267,6 +267,7 @@ class App(discord.Bot):
|
|||||||
self._app.include_router(self.router)
|
self._app.include_router(self.router)
|
||||||
uvicorn_options = uvicorn_options or {}
|
uvicorn_options = uvicorn_options or {}
|
||||||
uvicorn_options["log_level"] = uvicorn_options.get("log_level", logging.root.level)
|
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)
|
config = self._UvicornConfig(self._app, **uvicorn_options)
|
||||||
server = self._UvicornServer(config)
|
server = self._UvicornServer(config)
|
||||||
try:
|
try:
|
||||||
|
|||||||
2
uv.lock
generated
2
uv.lock
generated
@@ -319,7 +319,7 @@ dev = [
|
|||||||
requires-dist = [
|
requires-dist = [
|
||||||
{ name = "fastapi", specifier = ">=0.115.11" },
|
{ name = "fastapi", specifier = ">=0.115.11" },
|
||||||
{ name = "orjson", specifier = ">=3.10.15" },
|
{ 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 = "pynacl", specifier = ">=1.5.0" },
|
||||||
{ name = "uvicorn", specifier = ">=0.34.0" },
|
{ name = "uvicorn", specifier = ">=0.34.0" },
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user