From b2a923b06444c24b23e8778573b58996cbde7e66 Mon Sep 17 00:00:00 2001 From: Kaveen Kumarasinghe Date: Tue, 10 Jan 2023 21:44:50 -0500 Subject: [PATCH] auto terminate ask() --- cogs/gpt_3_commands_and_converser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogs/gpt_3_commands_and_converser.py b/cogs/gpt_3_commands_and_converser.py index fb1bdc74..7eb4b4bf 100644 --- a/cogs/gpt_3_commands_and_converser.py +++ b/cogs/gpt_3_commands_and_converser.py @@ -1113,6 +1113,10 @@ async def ask( user = ctx.user prompt = prompt.strip() + # If the prompt isn't empty and the last character isn't a punctuation character, add a period. + if prompt and prompt[-1] not in [".", "!", "?"]: + prompt += "." + user_api_key = None if USER_INPUT_API_KEYS: user_api_key = await GPT3ComCon.get_user_api_key(user.id, ctx)