more fixes
This commit is contained in:
parent
3fbc996de1
commit
1ef60193a0
13
src/main.py
13
src/main.py
@ -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)
|
||||
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
discord
|
||||
requests
|
||||
aiohttp
|
||||
Loading…
x
Reference in New Issue
Block a user