Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -161,8 +161,10 @@ async def on_message(message:discord.Message):
|
|
161 |
ats = []
|
162 |
if len(message.attachments) > 0:
|
163 |
for i in message.attachments:
|
164 |
-
|
165 |
-
|
|
|
|
|
166 |
try:
|
167 |
with open(os.path.join(guild_name, f"{msgchannel_name}.txt"), "a") as f:
|
168 |
f.write(s)
|
|
|
161 |
ats = []
|
162 |
if len(message.attachments) > 0:
|
163 |
for i in message.attachments:
|
164 |
+
if i.content_type == "image":
|
165 |
+
Image.open(io.BytesIO(i.read())).save("image.png")
|
166 |
+
ats.append(f"ImageInput:{caption("image.png")}")
|
167 |
+
s = f"GPT4 Correct {message.author}: {message.content} Attachments: {" ".join(ats)}<|end_of_turn|>"
|
168 |
try:
|
169 |
with open(os.path.join(guild_name, f"{msgchannel_name}.txt"), "a") as f:
|
170 |
f.write(s)
|