Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -156,20 +156,19 @@ async def on_message(message):
|
|
156 |
os.mkdir("data/" + guild_name)
|
157 |
except:
|
158 |
pass
|
159 |
-
|
160 |
with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
|
161 |
n = "\n"
|
162 |
f.write(
|
163 |
f"""GPT4 Correct {message.author.name}: {message.content.strip(n)}<|end_of_turn|>"""
|
164 |
)
|
165 |
-
|
166 |
with open(f"data/{guild_name}/{msgchannel_name}", "w") as f:
|
167 |
f.write(
|
168 |
f"GPT4 Correct system: {sysp}<|end_of_turn|>GPT4 Correct {message.author}: {message.content}<|end_of_turn|>"
|
169 |
)
|
170 |
-
|
171 |
-
|
172 |
-
context = f.read()
|
173 |
await syncMessages()
|
174 |
if "Feeway" in guild_name:
|
175 |
async with msgchannel.typing():
|
|
|
156 |
os.mkdir("data/" + guild_name)
|
157 |
except:
|
158 |
pass
|
159 |
+
if os.path.exists(f"data/{guild_name}/{msgchannel_name}"):
|
160 |
with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
|
161 |
n = "\n"
|
162 |
f.write(
|
163 |
f"""GPT4 Correct {message.author.name}: {message.content.strip(n)}<|end_of_turn|>"""
|
164 |
)
|
165 |
+
else:
|
166 |
with open(f"data/{guild_name}/{msgchannel_name}", "w") as f:
|
167 |
f.write(
|
168 |
f"GPT4 Correct system: {sysp}<|end_of_turn|>GPT4 Correct {message.author}: {message.content}<|end_of_turn|>"
|
169 |
)
|
170 |
+
with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
|
171 |
+
context = f.read()
|
|
|
172 |
await syncMessages()
|
173 |
if "Feeway" in guild_name:
|
174 |
async with msgchannel.typing():
|