more fixes
Some checks failed
Safety Check / safety-check (pull_request) Successful in -2s
Code Quality Check / quality-check (pull_request) Failing after 10s

This commit is contained in:
wirehack7 2025-05-01 15:55:54 +02:00
parent 3fbc996de1
commit 1ef60193a0
Signed by: wirehack7
GPG Key ID: C9F4CF85BA505ADC
2 changed files with 5 additions and 13 deletions

View File

@ -10,9 +10,9 @@ import sys
import time
import zipfile
import aiohttp
import discord
import requests
import aiohttp
from discord import app_commands
from discord.ext import commands
@ -160,12 +160,6 @@ async def generate(
}
start_time = time.monotonic()
response = requests.post(
"https://image.novelai.net/ai/generate-image",
json=payload,
headers=headers,
timeout=120,
)
async with aiohttp.ClientSession() as session:
async with session.post(
@ -221,10 +215,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)

View File

@ -1,2 +1,3 @@
discord
requests
aiohttp