creating thread moved earlier, upscaling message moved to thread...
Browse files
app.py
CHANGED
@@ -56,6 +56,9 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
56 |
return user == ctx.author and str(reaction.emoji) in ['1️⃣', '2️⃣', '3️⃣', '4️⃣']
|
57 |
|
58 |
await ctx.message.add_reaction('👍')
|
|
|
|
|
|
|
59 |
|
60 |
number_of_images = 4
|
61 |
current_time = int(time.time())
|
@@ -99,12 +102,14 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
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 |
#ctx.message
|
106 |
# could replace sent_message with initial user command message? try later
|
107 |
-
thread = await ctx.message.create_thread(name='Image Upscaling Thread')
|
|
|
|
|
108 |
#thread = await sent_message.create_thread(name='Image Upscaling Thread')
|
109 |
|
110 |
#4
|
@@ -120,19 +125,19 @@ async def deepfloydif(ctx, *, prompt: str):
|
|
120 |
|
121 |
reaction, user = await bot.wait_for('reaction_add', check=check_reaction)
|
122 |
if str(reaction.emoji) == '1️⃣':
|
123 |
-
await
|
124 |
index = 0
|
125 |
await dfif2(ctx, index, stage_1_result_path)
|
126 |
elif str(reaction.emoji) == '2️⃣':
|
127 |
-
await
|
128 |
index = 1
|
129 |
await dfif2(ctx, index, stage_1_result_path)
|
130 |
elif str(reaction.emoji) == '3️⃣':
|
131 |
-
await
|
132 |
index = 2
|
133 |
await dfif2(ctx, index, stage_1_result_path)
|
134 |
elif str(reaction.emoji) == '4️⃣':
|
135 |
-
await
|
136 |
index = 3
|
137 |
await dfif2(ctx, index, stage_1_result_path)
|
138 |
|
|
|
56 |
return user == ctx.author and str(reaction.emoji) in ['1️⃣', '2️⃣', '3️⃣', '4️⃣']
|
57 |
|
58 |
await ctx.message.add_reaction('👍')
|
59 |
+
thread = await ctx.message.create_thread(name='Image Upscaling Thread')
|
60 |
+
# create thread -> send new message inside thread + combined_image -> add reactions -> dfif2
|
61 |
+
sent_message = await ctx.reply('Creating thread...')
|
62 |
|
63 |
number_of_images = 4
|
64 |
current_time = int(time.time())
|
|
|
102 |
|
103 |
#2
|
104 |
# create thread -> send new message inside thread + combined_image -> add reactions -> dfif2
|
105 |
+
#sent_message = await ctx.reply('Creating thread...')
|
106 |
|
107 |
#3
|
108 |
#ctx.message
|
109 |
# could replace sent_message with initial user command message? try later
|
110 |
+
#thread = await ctx.message.create_thread(name='Image Upscaling Thread')
|
111 |
+
|
112 |
+
|
113 |
#thread = await sent_message.create_thread(name='Image Upscaling Thread')
|
114 |
|
115 |
#4
|
|
|
125 |
|
126 |
reaction, user = await bot.wait_for('reaction_add', check=check_reaction)
|
127 |
if str(reaction.emoji) == '1️⃣':
|
128 |
+
await thread.send("Upscaling the first image...")
|
129 |
index = 0
|
130 |
await dfif2(ctx, index, stage_1_result_path)
|
131 |
elif str(reaction.emoji) == '2️⃣':
|
132 |
+
await thread.send("Upscaling the second image...")
|
133 |
index = 1
|
134 |
await dfif2(ctx, index, stage_1_result_path)
|
135 |
elif str(reaction.emoji) == '3️⃣':
|
136 |
+
await thread.send("Upscaling the third image...")
|
137 |
index = 2
|
138 |
await dfif2(ctx, index, stage_1_result_path)
|
139 |
elif str(reaction.emoji) == '4️⃣':
|
140 |
+
await thread.send("Upscaling the fourth image...")
|
141 |
index = 3
|
142 |
await dfif2(ctx, index, stage_1_result_path)
|
143 |
|