Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
small change
Browse files Browse the repository at this point in the history
  • Loading branch information
FuseFairy committed Apr 21, 2024
1 parent 52b39a5 commit 4901af6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions src/image/image_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/user_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4901af6

Please sign in to comment.