lunarflu HF Staff commited on
Commit
3e91574
·
1 Parent(s): a334f66

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -581,6 +581,7 @@ async def falconprivate(ctx, *, prompt: str):
581
  global falcon_dictionary
582
  if ctx.channel.id == 1116089829147557999: # initial thread creation inside #falcon
583
  if ctx.author.id not in falcon_users: # create a new one
 
584
  thread = await ctx.message.create_thread(name=f'{ctx.author}')
585
  falcon_users = [ctx.author.id] + falcon_users
586
  falcon_threads = [thread.id] + falcon_threads
@@ -605,12 +606,13 @@ async def falconprivate(ctx, *, prompt: str):
605
  falcon_dictionary[ctx.author.id] = full_generation # 1234567890: tmp12345678.json
606
  print(output_text)
607
  await thread.send(f"{output_text}")
608
-
609
  elif ctx.author.id in falcon_users:
610
  await ctx.reply(f"{ctx.author.mention}, you already have an existing conversation! ")
611
 
612
  if ctx.channel.id in falcon_threads: # subsequent chatting inside threads of #falcon
613
- await ctx.reply(f"inside thread, only {ctx.author} is allowed to chat here")
 
614
  # post all other generations here
615
  chathistory = falcon_dictionary[ctx.author.id]
616
 
@@ -627,16 +629,16 @@ async def falconprivate(ctx, *, prompt: str):
627
  data = json.load(file)
628
  output_text = data[-1][-1] # we output this as the bot
629
  falcon_dictionary[ctx.author.id] = full_generation
630
-
631
  print(output_text)
632
  await ctx.reply(f"{output_text}")
 
633
 
634
  except Exception as e:
635
  print(f"Error: {e}")
636
  await ctx.reply(f"{e} cc <@811235357663297546> (falconprivate error)")
637
-
638
-
639
-
640
  @bot.command()
641
  async def falcon(ctx, *, prompt: str):
642
  try:
 
581
  global falcon_dictionary
582
  if ctx.channel.id == 1116089829147557999: # initial thread creation inside #falcon
583
  if ctx.author.id not in falcon_users: # create a new one
584
+ await ctx.message.add_reaction('<a:loading:1114111677990981692>')
585
  thread = await ctx.message.create_thread(name=f'{ctx.author}')
586
  falcon_users = [ctx.author.id] + falcon_users
587
  falcon_threads = [thread.id] + falcon_threads
 
606
  falcon_dictionary[ctx.author.id] = full_generation # 1234567890: tmp12345678.json
607
  print(output_text)
608
  await thread.send(f"{output_text}")
609
+ await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
610
  elif ctx.author.id in falcon_users:
611
  await ctx.reply(f"{ctx.author.mention}, you already have an existing conversation! ")
612
 
613
  if ctx.channel.id in falcon_threads: # subsequent chatting inside threads of #falcon
614
+ await ctx.message.add_reaction('<a:loading:1114111677990981692>')
615
+ #await ctx.reply(f"inside thread, only {ctx.author} is allowed to chat here")
616
  # post all other generations here
617
  chathistory = falcon_dictionary[ctx.author.id]
618
 
 
629
  data = json.load(file)
630
  output_text = data[-1][-1] # we output this as the bot
631
  falcon_dictionary[ctx.author.id] = full_generation
 
632
  print(output_text)
633
  await ctx.reply(f"{output_text}")
634
+ await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
635
 
636
  except Exception as e:
637
  print(f"Error: {e}")
638
  await ctx.reply(f"{e} cc <@811235357663297546> (falconprivate error)")
639
+ await ctx.message.remove_reaction('<a:loading:1114111677990981692>', bot.user)
640
+ await ctx.message.add_reaction('<:disagree:1098628957521313892>')
641
+
642
  @bot.command()
643
  async def falcon(ctx, *, prompt: str):
644
  try: