lunarflu HF Staff commited on
Commit
85b6226
Β·
1 Parent(s): 602130d

asyncio.create_task

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -31,8 +31,13 @@ bot = commands.Bot(command_prefix='!', intents=intents)
31
  @bot.command()
32
  async def jojo(ctx):
33
  attachment = await discord_before(ctx)
 
 
 
 
 
34
  im = await generation(attachment)
35
- await discord_after(ctx, im)
36
 
37
  async def discord_before(ctx):
38
  if ctx.message.attachments:
@@ -43,7 +48,7 @@ async def discord_before(ctx):
43
  else:
44
  await ctx.send(f"{ctx.author.mention} No attachments to be found... Can't animify dat! Try sending me an image πŸ˜‰")
45
  await ctx.message.add_reaction('❌')
46
- return False
47
 
48
  async def generation(attachment):
49
  if attachment:
 
31
  @bot.command()
32
  async def jojo(ctx):
33
  attachment = await discord_before(ctx)
34
+ if attachment:
35
+ asyncio.create_task(process_jojo(ctx, attachment))
36
+
37
+
38
+ async def process_jojo(ctx, attachment):
39
  im = await generation(attachment)
40
+ await discord_after(ctx, im)
41
 
42
  async def discord_before(ctx):
43
  if ctx.message.attachments:
 
48
  else:
49
  await ctx.send(f"{ctx.author.mention} No attachments to be found... Can't animify dat! Try sending me an image πŸ˜‰")
50
  await ctx.message.add_reaction('❌')
51
+ return None
52
 
53
  async def generation(attachment):
54
  if attachment: