thread test
Browse files
app.py
CHANGED
@@ -93,32 +93,25 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
93 |
# Trigger the second stage prediction
|
94 |
#await dfif2(ctx, stage_1_result_path)
|
95 |
|
96 |
-
|
97 |
-
tmsg = await ctx.reply('Image will be in the thread')
|
98 |
-
|
99 |
-
# public thread
|
100 |
-
thread = await tmsg_message.create_public_thread(name='Upscale Thread', auto_archive_duration=60) # Adjust the thread settings as needed
|
101 |
-
|
102 |
-
timg = await thread('Here is the combined image. React with the image number you want to upscale!', file=discord.File(f, 'combined_image.png'))
|
103 |
-
|
104 |
-
# Add a reaction to the sent message to visually indicate the thread
|
105 |
-
await sent_message.add_reaction('🔗')
|
106 |
-
|
107 |
|
|
|
|
|
108 |
|
|
|
|
|
|
|
109 |
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
'''
|
115 |
-
|
116 |
|
|
|
|
|
117 |
|
118 |
# bot reacts with appropriate emojis to the post, both showing the user what options they have,
|
119 |
# as well as showing which post to react to.
|
120 |
for emoji in ['1️⃣', '2️⃣', '3️⃣', '4️⃣']:
|
121 |
-
await
|
122 |
|
123 |
reaction, user = await bot.wait_for('reaction_add', check=check_reaction)
|
124 |
if str(reaction.emoji) == '1️⃣':
|
|
|
93 |
# Trigger the second stage prediction
|
94 |
#await dfif2(ctx, stage_1_result_path)
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
#1
|
98 |
+
sent_message = None
|
99 |
|
100 |
+
#2
|
101 |
+
# create thread -> send new message inside thread + combined_image -> add reactions -> dfif2
|
102 |
+
sent_message = await ctx.reply('Creating thread...')
|
103 |
|
104 |
+
#3
|
105 |
+
# Create a public thread based on the sent message
|
106 |
+
thread = await sent_message.create_thread(name='Image Upscaling Thread')
|
|
|
|
|
|
|
107 |
|
108 |
+
#4
|
109 |
+
threadmsg = await thread.send('Here is the combined image. React with the image number you want to upscale!', file=discord.File(f, 'combined_image.png'))
|
110 |
|
111 |
# bot reacts with appropriate emojis to the post, both showing the user what options they have,
|
112 |
# as well as showing which post to react to.
|
113 |
for emoji in ['1️⃣', '2️⃣', '3️⃣', '4️⃣']:
|
114 |
+
await threadmsg.add_reaction(emoji)
|
115 |
|
116 |
reaction, user = await bot.wait_for('reaction_add', check=check_reaction)
|
117 |
if str(reaction.emoji) == '1️⃣':
|