@@ -1584,6 +1584,25 @@ async def edit(self, ctx, message_id: Optional[int] = None, *, message: str):
15841584 @checks .has_permissions (PermissionLevel .REGULAR )
15851585 async def selfcontact (self , ctx ):
15861586 """Creates a thread with yourself"""
1587+ # Check if user already has a thread
1588+ existing_thread = await self .bot .threads .find (recipient = ctx .author )
1589+ if existing_thread :
1590+ if existing_thread .snoozed :
1591+ # Unsnooze the thread
1592+ await ctx .send (f"ℹ️ You had a snoozed thread. Unsnoozing now..." )
1593+ await existing_thread .restore_from_snooze ()
1594+ self .bot .threads .cache [existing_thread .id ] = existing_thread
1595+ return
1596+ else :
1597+ # Thread already exists and is active
1598+ embed = discord .Embed (
1599+ title = "Thread not created" ,
1600+ description = f"A thread for you already exists in { existing_thread .channel .mention } ." ,
1601+ color = self .bot .error_color ,
1602+ )
1603+ await ctx .send (embed = embed , delete_after = 10 )
1604+ return
1605+
15871606 await ctx .invoke (self .contact , users = [ctx .author ])
15881607
15891608 @commands .command (usage = "<user> [category] [options]" )
@@ -1642,9 +1661,14 @@ async def contact(
16421661 users += u .members
16431662 users .remove (u )
16441663
1664+ snoozed_users = []
16451665 for u in list (users ):
16461666 exists = await self .bot .threads .find (recipient = u )
16471667 if exists :
1668+ # Check if thread is snoozed
1669+ if exists .snoozed :
1670+ snoozed_users .append (u )
1671+ continue
16481672 errors .append (f"A thread for { u } already exists." )
16491673 if exists .channel :
16501674 errors [- 1 ] += f" in { exists .channel .mention } "
@@ -1658,6 +1682,17 @@ async def contact(
16581682 errors .append (f"{ ref } currently blocked from contacting { self .bot .user .name } ." )
16591683 users .remove (u )
16601684
1685+ # Handle snoozed users - unsnooze them and return early
1686+ if snoozed_users :
1687+ for u in snoozed_users :
1688+ thread = await self .bot .threads .find (recipient = u )
1689+ if thread and thread .snoozed :
1690+ await ctx .send (f"ℹ️ { u .mention } had a snoozed thread. Unsnoozing now..." )
1691+ await thread .restore_from_snooze ()
1692+ self .bot .threads .cache [thread .id ] = thread
1693+ # Don't try to create a new thread - we just unsnoozed existing ones
1694+ return
1695+
16611696 if len (users ) > 5 :
16621697 errors .append ("Group conversations only support 5 users." )
16631698 users = []
@@ -1674,7 +1709,6 @@ async def contact(
16741709 await ctx .send (embed = embed , delete_after = 10 )
16751710
16761711 if not users :
1677- # end
16781712 return
16791713
16801714 creator = ctx .author if manual_trigger else users [0 ]
0 commit comments