lunarflu HF Staff commited on
Commit
458a3b3
·
1 Parent(s): 288d2d0

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (1) hide show
  1. app.py +41 -0
app.py CHANGED
@@ -560,6 +560,47 @@ async def on_reaction_add(reaction, user): # ctx = await bot.get_context(reac
560
  #----------------------------------------------------------------------------------------------------------------------------
561
  chathistory = None
562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
563
  @bot.command()
564
  async def falcon(ctx, *, prompt: str):
565
  try:
 
560
  #----------------------------------------------------------------------------------------------------------------------------
561
  chathistory = None
562
 
563
+
564
+ falcon_chats = []
565
+ falcon_threads = []
566
+
567
+ @bot.command()
568
+ async def falconprivate(ctx):
569
+ try:
570
+ global falcon_chats
571
+ if ctx.channel.id == 1116089829147557999: # #falcon
572
+ if ctx.author.id not in falcon_chats: # create a new one
573
+ thread = await ctx.message.create_thread(name=f'{ctx.author}')
574
+ falcon_chats = [ctx.author.id] + falcon_chats
575
+
576
+ elif ctx.author.id in falcon_chats:
577
+ ctx.reply(f"{ctx.author.mention}, you already have an existing conversation! ")
578
+
579
+ if ctx.channel.name == ctx.author:
580
+ ctx.reply(f"inside thread")
581
+ except Exception as e:
582
+ print(f"Error: {e}")
583
+ await ctx.reply(f"{e} cc <@811235357663297546> (falconprivate error)")
584
+
585
+ '''
586
+
587
+ store thread_id in falcon_threads
588
+ generate response
589
+ store response in falcon_chats
590
+ send response in thread
591
+ '''
592
+
593
+ # store file in custom falcon_chats path
594
+ # name file in falcon_chats using ctx.author.id
595
+
596
+ '''
597
+ if ctx.author.id in falcon_chats:
598
+ ctx.reply(f"{ctx.author.mention}, you already have an existing conversation! Use [under construction] to start a new one.")
599
+ # max 1 convo
600
+ # can only continue in thread
601
+ # auto clear?
602
+ '''
603
+
604
  @bot.command()
605
  async def falcon(ctx, *, prompt: str):
606
  try: