From 70f395c0a7aeb41ced7fe42c4b8e8b13c305bc48 Mon Sep 17 00:00:00 2001 From: nsde Date: Thu, 3 Aug 2023 01:44:58 +0200 Subject: [PATCH] Small improvements --- cord/accounts.py | 5 +++-- cord/chatbot.py | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cord/accounts.py b/cord/accounts.py index 1312cdc..3aef13d 100644 --- a/cord/accounts.py +++ b/cord/accounts.py @@ -31,7 +31,7 @@ Please report this issue to the staff!""", ephemeral=True) if user_response.status_code == 404: await embedder.error(interaction, """You don't have an account yet!""", ephemeral=True) - raise ValueError('Account not found.') + return return user_response.json() @@ -52,7 +52,8 @@ Learn more about how to use our API at **https://nova-oss.com**. async def get_credits(interaction): account = await get_account(interaction) + amount_credits = account["credits"] await embedder.info(interaction, f"""### Your credits -**Amount:** `{account["credits"]}` +Amount: **{amount_credits if amount_credits < 1000000 else '∞'}** """, ephemeral=True) diff --git a/cord/chatbot.py b/cord/chatbot.py index a6ab612..2e9a749 100644 --- a/cord/chatbot.py +++ b/cord/chatbot.py @@ -22,12 +22,12 @@ async def respond(interaction, prompt): model=model, messages=[ {'role': 'system', 'content': f"""You are a helpful Discord AI bot based on OpenAI\'s {model} model called "Nova". - You were developed by NovaAI (website: nova-oss.com) in July of 2023, but your knowledge is limited to mid-2021. - Respond using Markdown. Keep things simple and short and directly do what the user says without any fluff. - For programming code, always make use formatted code blocks like this: - ```py +You were developed by NovaAI (website: nova-oss.com) in July of 2023, but your knowledge is limited to mid-2021. +Respond using Markdown. Keep things simple and short and directly do what the user says without any fluff. +For programming code, always make use formatted code blocks like this: +```py print("Hello") - ``` +``` """}, {'role': 'user', 'content': prompt} ],