Synced repo using 'sync_with_huggingface' Github Action
Browse files
app.py
CHANGED
@@ -568,21 +568,26 @@ falcon_threads = []
|
|
568 |
async def falconprivate(ctx):
|
569 |
try:
|
570 |
global falcon_chats
|
571 |
-
|
|
|
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 |
await thread.send(f"Thread created")
|
576 |
|
577 |
elif ctx.author.id in falcon_chats:
|
578 |
await ctx.reply(f"{ctx.author.mention}, you already have an existing conversation! ")
|
579 |
-
|
580 |
-
if
|
581 |
await ctx.reply(f"inside thread, only {ctx.author} is allowed to chat here")
|
|
|
582 |
except Exception as e:
|
583 |
print(f"Error: {e}")
|
584 |
await ctx.reply(f"{e} cc <@811235357663297546> (falconprivate error)")
|
585 |
|
|
|
|
|
586 |
@bot.command()
|
587 |
async def falcon(ctx, *, prompt: str):
|
588 |
try:
|
|
|
568 |
async def falconprivate(ctx):
|
569 |
try:
|
570 |
global falcon_chats
|
571 |
+
global falcon_threads
|
572 |
+
if ctx.channel.id == 1116089829147557999: # initial thread creation inside #falcon
|
573 |
if ctx.author.id not in falcon_chats: # create a new one
|
574 |
thread = await ctx.message.create_thread(name=f'{ctx.author}')
|
575 |
falcon_chats = [ctx.author.id] + falcon_chats
|
576 |
+
falcon_threads = [thread.id] + falcon_threads
|
577 |
await thread.send(f"Thread created")
|
578 |
|
579 |
elif ctx.author.id in falcon_chats:
|
580 |
await ctx.reply(f"{ctx.author.mention}, you already have an existing conversation! ")
|
581 |
+
|
582 |
+
if ctx.channel.id in falcon_threads: # subsequent chatting inside threads of #falcon
|
583 |
await ctx.reply(f"inside thread, only {ctx.author} is allowed to chat here")
|
584 |
+
|
585 |
except Exception as e:
|
586 |
print(f"Error: {e}")
|
587 |
await ctx.reply(f"{e} cc <@811235357663297546> (falconprivate error)")
|
588 |
|
589 |
+
|
590 |
+
|
591 |
@bot.command()
|
592 |
async def falcon(ctx, *, prompt: str):
|
593 |
try:
|