From 4901af6f5b9d7460e00bd742aeec3c395c052c72 Mon Sep 17 00:00:00 2001 From: FuseFairy Date: Sun, 21 Apr 2024 20:28:36 +0800 Subject: [PATCH] small change --- src/image/image_create.py | 6 ------ src/user_chatbot.py | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/image/image_create.py b/src/image/image_create.py index c1d634d..a084b04 100644 --- a/src/image/image_create.py +++ b/src/image/image_create.py @@ -32,12 +32,6 @@ async def create_image_dalle3(interaction: discord.Interaction, prompt: str, cha "style": 'vivid', "user": 'free-dall-e-user' } - - if api_key == None and os.getenv("dalle3_unofficial_apikey"): - api_key = os.getenv("dalle3_unofficial_apikey") - elif api_key == None: - await interaction.followup.send(f"> **ERROR:Please use `/dalle3 setting` to set your api key, api key can get from https://dalle.feiyuyu.net/dashboard**") - return headers = {"Authorization": "Bearer " + api_key} async with aiohttp.ClientSession() as session: diff --git a/src/user_chatbot.py b/src/user_chatbot.py index d2b2796..e9e0932 100644 --- a/src/user_chatbot.py +++ b/src/user_chatbot.py @@ -154,7 +154,7 @@ async def create_image(self, interaction: discord.Interaction, prompt: str, serv if self.dalle3_unoffcial_apikey == None and os.getenv("DALLE3_UNOFFICIAL_APIKEY"): self.dalle3_unoffcial_apikey = os.getenv("DALLE3_UNOFFICIAL_APIKEY") elif self.dalle3_unoffcial_apikey == None: - await interaction.followup.send("> **ERROR:Please upload your api key.**") + await interaction.followup.send("> **ERROR:Please use `/dalle3 setting` to set your api key, api key can get from https://dalle.feiyuyu.net/dashboard**") return async with self.sem_create_image_dalle3: await create_image_dalle3(interaction, prompt, self)