Compare commits
No commits in common. "main" and "v0.2.1" have entirely different histories.
@ -15,12 +15,12 @@ jobs:
|
||||
GITHUB: ${{ secrets.GITHUB }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v6
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.14'
|
||||
python-version: '3.13'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
@ -85,7 +85,7 @@ jobs:
|
||||
|
||||
# Ergebnisse als Artefakte speichern
|
||||
- name: Upload results as artifacts
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: quality-reports
|
||||
path: /tmp/results
|
||||
|
||||
@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Verify Docker installation
|
||||
run: docker --version
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM python:3.14.2-slim
|
||||
FROM python:3.13.3-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
12
src/main.py
12
src/main.py
@ -58,7 +58,7 @@ async def on_ready():
|
||||
orientation="portrait or landscape (Standard: portrait)",
|
||||
seed="Optional seed (integer). If empty, a random one will be generated",
|
||||
)
|
||||
# pylint: disable=too-many-locals,too-many-return-statements,too-many-statements
|
||||
# pylint: disable=too-many-locals,too-many-return-statements
|
||||
async def generate(
|
||||
interaction: discord.Interaction,
|
||||
prompt: str,
|
||||
@ -159,7 +159,7 @@ async def generate(
|
||||
}
|
||||
|
||||
start_time = time.monotonic()
|
||||
try:
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.post(
|
||||
"https://image.novelai.net/ai/generate-image",
|
||||
@ -169,10 +169,6 @@ async def generate(
|
||||
) as response:
|
||||
response_bytes = await response.read()
|
||||
status_code = response.status
|
||||
except aiohttp.TimeoutError:
|
||||
await interaction.followup.send("Error: the request timed out.")
|
||||
except aiohttp.ClientError as e:
|
||||
await interaction.followup.send(f"Error: {e}")
|
||||
|
||||
duration = time.monotonic() - start_time
|
||||
logger.info("Image creation took %.2f seconds", duration)
|
||||
@ -218,9 +214,7 @@ async def generate(
|
||||
except Exception: # pylint: disable=W0718
|
||||
error_data = "error message unreadable"
|
||||
|
||||
error_message = (
|
||||
f"Error {status_code} at API-request.\n" f"Answer: {error_data}\n"
|
||||
)
|
||||
error_message = f"Error {status_code} at API-request.\n" f"Answer: {error_data}\n"
|
||||
|
||||
await interaction.followup.send(error_message)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user