fixing threads
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
53 |
prompt = re.sub(r'[^\w\s]', '', prompt) # Remove special characters
|
54 |
|
55 |
def check_reaction(reaction, user):
|
56 |
-
return user == ctx.author and str(reaction.emoji) in ['1️⃣', '2️⃣', '3️⃣', '4️⃣']
|
57 |
|
58 |
await ctx.message.add_reaction('👍')
|
59 |
|
@@ -91,15 +91,13 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
91 |
|
92 |
combined_image_path = os.path.join(stage_1_results, 'combined_image.png')
|
93 |
combined_image.save(combined_image_path)
|
94 |
-
|
95 |
-
# creates a thread, passing the combined_image_path in
|
96 |
-
await create_thread_dfif(ctx, combined_image_path)
|
97 |
|
98 |
# open combined image in a thread, mention the user
|
99 |
with open(combined_image_path, 'rb') as f:
|
100 |
thread_channel = await ctx.channel.create_thread(name='Image Thread')
|
101 |
-
sent_message = await
|
102 |
-
|
|
|
103 |
# bot reacts with appropriate emojis to the post, both showing the user what options they have,
|
104 |
# as well as showing which post to react to.
|
105 |
for emoji in ['1️⃣', '2️⃣', '3️⃣', '4️⃣']:
|
|
|
53 |
prompt = re.sub(r'[^\w\s]', '', prompt) # Remove special characters
|
54 |
|
55 |
def check_reaction(reaction, user):
|
56 |
+
return user == ctx.author and str(reaction.emoji) in ['1️⃣', '2️⃣', '3️⃣', '4️⃣'] # is this used?
|
57 |
|
58 |
await ctx.message.add_reaction('👍')
|
59 |
|
|
|
91 |
|
92 |
combined_image_path = os.path.join(stage_1_results, 'combined_image.png')
|
93 |
combined_image.save(combined_image_path)
|
|
|
|
|
|
|
94 |
|
95 |
# open combined image in a thread, mention the user
|
96 |
with open(combined_image_path, 'rb') as f:
|
97 |
thread_channel = await ctx.channel.create_thread(name='Image Thread')
|
98 |
+
sent_message = await thread_channel.send('Here is the combined image. React with the image number you want to upscale!',
|
99 |
+
file=discord.File(f, 'combined_image.png'))
|
100 |
+
|
101 |
# bot reacts with appropriate emojis to the post, both showing the user what options they have,
|
102 |
# as well as showing which post to react to.
|
103 |
for emoji in ['1️⃣', '2️⃣', '3️⃣', '4️⃣']:
|