lunarflu HF Staff commited on
Commit
2305adb
Β·
1 Parent(s): d83af0d

auto_archive_duration >>> 60, [jojo] await thread.edit(archived=True)

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -161,7 +161,7 @@ async def jojo(ctx):
161
  try:
162
  if await safetychecks(ctx): #βœ…
163
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
164
- thread = await ctx.message.create_thread(name=f'Jojo | {ctx.author}', auto_archive_duration=1)
165
  if ctx.message.attachments:
166
  await thread.send(f'{ctx.author.mention} Generating images in thread, can take ~1 minute...yare yare, daze ...')
167
  attachment = ctx.message.attachments[0]
@@ -175,16 +175,19 @@ async def jojo(ctx):
175
  # <a:hugging_spin:1102656012621713488>
176
  await ctx.message.add_reaction('<:agree:1098629085955113011>') # βœ…
177
  await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
 
178
  else: # no image
179
  await thread.send(f"{ctx.author.mention} No attachments to be found...Can't animify dat! Try sending me an image πŸ˜‰")
180
  await ctx.message.add_reaction('<:disagree:1098628957521313892>') # ❌
181
  await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
 
182
  except Exception as e: # no generation / img + no face
183
  await fullqueue(e, thread)
184
  print(f"Error: {e}")
185
  await thread.send(f"{ctx.author.mention} Error: {e}")
186
  await ctx.message.add_reaction('<:disagree:1098628957521313892>') # ❌
187
  await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
 
188
 
189
  #----------------------------------------------------------------------------------------------------------------------------------------------
190
  # Disney ❌
@@ -193,7 +196,7 @@ async def disney(ctx):
193
  try:
194
  if await safetychecks(ctx): #βœ…
195
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
196
- thread = await ctx.message.create_thread(name=f'Disney | {ctx.author}', auto_archive_duration=1)
197
  if ctx.message.attachments:
198
  await thread.send(f'{ctx.author.mention} Generating images in thread, can take ~1 minute...')
199
  attachment = ctx.message.attachments[0]
@@ -221,7 +224,7 @@ async def spidey(ctx):
221
  try:
222
  if await safetychecks(ctx): #βœ…
223
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
224
- thread = await ctx.message.create_thread(name=f'Spider-verse | {ctx.author}', auto_archive_duration=1)
225
  if ctx.message.attachments:
226
  await thread.send(f'{ctx.author.mention} Generating images in thread, can take ~1 minute...')
227
  attachment = ctx.message.attachments[0]
@@ -248,7 +251,7 @@ async def sketch(ctx):
248
  try:
249
  if await safetychecks(ctx): #βœ…
250
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
251
- thread = await ctx.message.create_thread(name=f'Sketch | {ctx.author}', auto_archive_duration=1)
252
  if ctx.message.attachments:
253
  await thread.send(f'{ctx.author.mention} Generating images in thread, can take ~1 minute...')
254
  attachment = ctx.message.attachments[0]
@@ -317,7 +320,7 @@ async def deepfloydif(ctx, *, prompt: str):
317
  if await safetychecks(ctx): #βœ…
318
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
319
  dfif_command_message_id = ctx.message.id # we will use this in some magic later on
320
- thread = await ctx.message.create_thread(name=f'DeepfloydIF | {prompt}', auto_archive_duration=1) # could also just use prompt, no deepfloydif
321
  # create thread -> send new message inside thread + combined_image -> add reactions -> dfif2
322
 
323
  #current_time = int(time.time())
 
161
  try:
162
  if await safetychecks(ctx): #βœ…
163
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
164
+ thread = await ctx.message.create_thread(name=f'Jojo | {ctx.author}', auto_archive_duration=60)
165
  if ctx.message.attachments:
166
  await thread.send(f'{ctx.author.mention} Generating images in thread, can take ~1 minute...yare yare, daze ...')
167
  attachment = ctx.message.attachments[0]
 
175
  # <a:hugging_spin:1102656012621713488>
176
  await ctx.message.add_reaction('<:agree:1098629085955113011>') # βœ…
177
  await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
178
+ await thread.edit(archived=True)
179
  else: # no image
180
  await thread.send(f"{ctx.author.mention} No attachments to be found...Can't animify dat! Try sending me an image πŸ˜‰")
181
  await ctx.message.add_reaction('<:disagree:1098628957521313892>') # ❌
182
  await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
183
+ await thread.edit(archived=True)
184
  except Exception as e: # no generation / img + no face
185
  await fullqueue(e, thread)
186
  print(f"Error: {e}")
187
  await thread.send(f"{ctx.author.mention} Error: {e}")
188
  await ctx.message.add_reaction('<:disagree:1098628957521313892>') # ❌
189
  await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
190
+ await thread.edit(archived=True)
191
 
192
  #----------------------------------------------------------------------------------------------------------------------------------------------
193
  # Disney ❌
 
196
  try:
197
  if await safetychecks(ctx): #βœ…
198
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
199
+ thread = await ctx.message.create_thread(name=f'Disney | {ctx.author}', auto_archive_duration=60)
200
  if ctx.message.attachments:
201
  await thread.send(f'{ctx.author.mention} Generating images in thread, can take ~1 minute...')
202
  attachment = ctx.message.attachments[0]
 
224
  try:
225
  if await safetychecks(ctx): #βœ…
226
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
227
+ thread = await ctx.message.create_thread(name=f'Spider-verse | {ctx.author}', auto_archive_duration=60)
228
  if ctx.message.attachments:
229
  await thread.send(f'{ctx.author.mention} Generating images in thread, can take ~1 minute...')
230
  attachment = ctx.message.attachments[0]
 
251
  try:
252
  if await safetychecks(ctx): #βœ…
253
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
254
+ thread = await ctx.message.create_thread(name=f'Sketch | {ctx.author}', auto_archive_duration=60)
255
  if ctx.message.attachments:
256
  await thread.send(f'{ctx.author.mention} Generating images in thread, can take ~1 minute...')
257
  attachment = ctx.message.attachments[0]
 
320
  if await safetychecks(ctx): #βœ…
321
  await ctx.message.add_reaction('<a:loading:1114111677990981692>')
322
  dfif_command_message_id = ctx.message.id # we will use this in some magic later on
323
+ thread = await ctx.message.create_thread(name=f'DeepfloydIF | {prompt}', auto_archive_duration=60) # could also just use prompt, no deepfloydif
324
  # create thread -> send new message inside thread + combined_image -> add reactions -> dfif2
325
 
326
  #current_time = int(time.time())