mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
Custom text error incase api key is expired or got rate limiter
Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
parent
c879c510f4
commit
8fe69d3457
1 changed files with 3 additions and 1 deletions
|
|
@ -108,7 +108,9 @@ async def openai_chatbot(_, ctx: Message, strings):
|
||||||
except APIConnectionError as e:
|
except APIConnectionError as e:
|
||||||
await msg.edit_msg(f"The server could not be reached because {e.__cause__}")
|
await msg.edit_msg(f"The server could not be reached because {e.__cause__}")
|
||||||
except RateLimitError as e:
|
except RateLimitError as e:
|
||||||
await msg.edit_msg("A 429 status code was received; we should back off a bit.")
|
if "billing details" in e:
|
||||||
|
return await msg.edit_msg("This openai key from this bot has expired, please give openai key donation for bot owner.")
|
||||||
|
await msg.edit_msg("You're got rate limit, please try again later.")
|
||||||
except APIStatusError as e:
|
except APIStatusError as e:
|
||||||
await msg.edit_msg(f"Another {e.status_code} status code was received with response {e.response}")
|
await msg.edit_msg(f"Another {e.status_code} status code was received with response {e.response}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue