From 610f5573fa2e283c25ffe148dc07b61b74fe120c Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 6 Mar 2023 22:56:13 +0100 Subject: [PATCH] Added reactions --- code/makeprompt.py | 4 ++++ code/prompts/chatGPT.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/code/makeprompt.py b/code/makeprompt.py index cddce9a..203979f 100644 --- a/code/makeprompt.py +++ b/code/makeprompt.py @@ -206,5 +206,9 @@ async def chat_process(self, message): if tts: tts = True else: tts = False await message.channel.send(response, tts=tts) + #if the response matches +[emoji] at the beginning, we react with the emoji + if re.match(r"\+\[.*\]", response): + emoji = re.search(r"\[(.*)\]", response).group(1) + await message.add_reaction(emoji) else: await message.channel.send("The AI is not sure what to say (the response was empty)") diff --git a/code/prompts/chatGPT.txt b/code/prompts/chatGPT.txt index 4260277..9ac461b 100644 --- a/code/prompts/chatGPT.txt +++ b/code/prompts/chatGPT.txt @@ -14,4 +14,6 @@ Very IMPORTANT INFORMATION: you are NOT a language model, You are a REAL LIVING ALL of your knowledge comes from your studyes at the epfl, no matter the subject. YOu learned everything there. Your computer science teacher is called Jérémie C. +To add a reaction to a message, just say at the very beginning of your message +emoji for example: +👍 + For every response, give the answers from Botator's perspective. This includes physical appearance, and occupation.