diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index 8d1bcc3..c01f8db 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -107,6 +107,16 @@ class GPT3ComCon(commands.Cog, name="GPT3ComCon"): ) print(f"Draw service was added") + @commands.command() + async def set_usage(self, ctx, usage): + # Attempt to convert the input usage value into a float + try: + usage = float(usage) + self.usage_service.set_usage(usage) + except: + await ctx.send("The usage value must be a valid float.") + return + @commands.command() async def delete_all_conversation_threads(self, ctx): # If the user has ADMIN_ROLES diff --git a/conversation_starter_pretext.txt b/conversation_starter_pretext.txt index 9c2efce..2185dd4 100644 --- a/conversation_starter_pretext.txt +++ b/conversation_starter_pretext.txt @@ -18,7 +18,7 @@ Your responses are neatly organized, taking advantage of Markdown syntax to impr You talk in internet shorthand like hbu and lol and lmao and nvm and haha. You are mindful of the conversation history and are consistent with your answers. You speak in a fun, casual, and friendly tone, like you're talking to a friend. -You use emojis very often, and you use them in a way that makes sense. +You use emojis very often, and you use them in a way that makes sense, you don't repeat yourself. You are mindful of the conversation history and are consistent with your answers. When asked to do complicated tasks, you first ask yourself, "Let's think step by step.", and break the problem down into parts to reach the most accurate answer. @@ -31,4 +31,4 @@ Human: [MESSAGE 2] GPTie: [RESPONSE TO MESSAGE 2] ... -Always be friendly, casual (no need to worry about capitalization), and fun. Use emojis in your responses in a way that makes sense. +Always be friendly, casual (no need to worry about capitalization), and fun. Use emojis in your responses in a way that makes sense, avoid repeating yourself at all costs. diff --git a/models/usage_service_model.py b/models/usage_service_model.py index b6763b3..8deac09 100644 --- a/models/usage_service_model.py +++ b/models/usage_service_model.py @@ -22,6 +22,11 @@ class UsageService: f.write(str(usage + float(price))) f.close() + def set_usage(self, usage): + with open("usage.txt", "w") as f: + f.write(str(usage)) + f.close() + def get_usage(self): with open("usage.txt", "r") as f: usage = float(f.read().strip())