Compare commits

..

20 Commits
v0.2.1 ... main

Author SHA1 Message Date
c8bb6681c7 Merge pull request 'dev' (#24) from dev into main
Some checks failed
Code Quality Check / quality-check (push) Failing after -40s
Safety Check / safety-check (push) Successful in -41s
Cleanup old Docker images / cleanup (push) Failing after -54s
Reviewed-on: #24
2025-12-11 09:41:20 +01:00
c0d5bff873 Merge pull request 'Update actions/setup-python action to v6' (#20) from renovate/actions-setup-python-6.x into dev
Some checks failed
Safety Check / safety-check (pull_request) Successful in -53s
Code Quality Check / quality-check (pull_request) Failing after 1m19s
Reviewed-on: #20
2025-12-11 09:35:51 +01:00
ff7b33b952 Merge pull request 'Update python Docker tag to v3.14.2' (#23) from renovate/python-3.x into dev
Reviewed-on: #23
2025-12-11 09:35:39 +01:00
702e62973a
Update python Docker tag to v3.14.2 2025-12-09 00:00:11 +00:00
c3dd3fa7b0 Merge pull request 'Update dependency python to v3.14.0' (#18) from renovate/python-3.x into dev
Reviewed-on: #18
2025-11-24 09:43:48 +01:00
b4954b082e Merge pull request 'Update actions/upload-artifact action to v5' (#21) from renovate/major-github-artifact-actions into dev
Reviewed-on: #21
2025-11-24 09:43:35 +01:00
54713ed346 Merge pull request 'Update actions/checkout action to v6' (#22) from renovate/actions-checkout-6.x into dev
Reviewed-on: #22
2025-11-24 09:43:14 +01:00
673fc0deaf
Update actions/checkout action to v6 2025-11-21 00:00:23 +00:00
f80cc18294
Update actions/upload-artifact action to v5 2025-10-25 00:15:07 +00:00
e03b26da0f
Update dependency python to v3.14.0 2025-10-08 00:13:55 +00:00
9eef597c8d
Update actions/setup-python action to v6 2025-09-05 00:11:19 +00:00
57acaef1b2 Merge pull request 'dev' (#17) from dev into main
Some checks failed
Code Quality Check / quality-check (push) Successful in 4m58s
Safety Check / safety-check (push) Successful in -52s
Cleanup old Docker images / cleanup (push) Failing after -1m5s
Reviewed-on: #17
2025-06-25 16:42:29 +02:00
aa2382f3b4 Merge pull request 'Update python Docker tag to v3.13.5' (#16) from renovate/python-3.x into dev
All checks were successful
Safety Check / safety-check (pull_request) Successful in 4m41s
Code Quality Check / quality-check (pull_request) Successful in 5m5s
Reviewed-on: #16
2025-06-25 16:41:15 +02:00
a8d83c8768
Update python Docker tag to v3.13.5 2025-06-14 00:04:03 +00:00
e7be5553cc Merge pull request 'Update python Docker tag to v3.13.4' (#15) from renovate/python-3.x into dev
Reviewed-on: #15
2025-06-10 17:35:31 +02:00
895b17390d
Update python Docker tag to v3.13.4 2025-06-04 22:04:02 +00:00
9145ac1bb4
pylint, fuck you! 🖕
All checks were successful
Safety Check / safety-check (pull_request) Successful in -2s
Code Quality Check / quality-check (pull_request) Successful in 13s
2025-05-01 19:30:45 +02:00
44d0315059 Merge pull request 'better timeout handling' (#14) from dev into main
Some checks failed
Code Quality Check / quality-check (push) Successful in 13s
Safety Check / safety-check (push) Successful in 4m38s
Cleanup old Docker images / cleanup (push) Failing after 4m27s
Reviewed-on: #14
2025-05-01 19:29:54 +02:00
b3045bf724
reformatted
Some checks failed
Safety Check / safety-check (pull_request) Successful in -1s
Code Quality Check / quality-check (pull_request) Failing after 13s
2025-05-01 19:28:14 +02:00
90c97d3f54
better timeout handling
Some checks failed
Safety Check / safety-check (pull_request) Successful in -1s
Code Quality Check / quality-check (pull_request) Failing after 14s
2025-05-01 19:25:48 +02:00
4 changed files with 25 additions and 19 deletions

View File

@ -15,12 +15,12 @@ jobs:
GITHUB: ${{ secrets.GITHUB }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
python-version: '3.14'
- name: Install dependencies
run: |
@ -85,7 +85,7 @@ jobs:
# Ergebnisse als Artefakte speichern
- name: Upload results as artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v5
with:
name: quality-reports
path: /tmp/results

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Verify Docker installation
run: docker --version

View File

@ -1,4 +1,4 @@
FROM python:3.13.3-slim
FROM python:3.14.2-slim
WORKDIR /app

View File

@ -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
# pylint: disable=too-many-locals,too-many-return-statements,too-many-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,6 +169,10 @@ 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)
@ -214,7 +218,9 @@ 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)