From 28ce15fa6be1500bd2848d2a316e029d60b3cf24 Mon Sep 17 00:00:00 2001 From: "suspendedtundra2@gmail.com" Date: Thu, 21 Mar 2024 15:01:05 -0500 Subject: [PATCH 1/3] fix: registration adds the registrant to the db --- src/func/Union.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/func/Union.py b/src/func/Union.py index 40c4573..def3691 100644 --- a/src/func/Union.py +++ b/src/func/Union.py @@ -11,6 +11,7 @@ pos_color, registration_channel_id, staff_impersonation_embed, ticket_categories, unknown_ign_embed, join_request_embed) +from src.utils.db_utils import update_member, insert_new_member from src.utils.discord_utils import (create_ticket, has_tag_perms, is_linked_discord) from src.utils.request_utils import (get_gtag, get_hypixel_player, @@ -167,6 +168,10 @@ async def register(self, ctx, name): if ign in bot.staff_names: return staff_impersonation_embed, None + await insert_new_member(discord_id=self.user.id, + uuid=uuid, + username=ign) + # Fetch player & guild data guild_data = await get_player_guild(uuid) From bbc2c021e0c2c01fb36ae73125f1b181c6df00da Mon Sep 17 00:00:00 2001 From: "suspendedtundra2@gmail.com" Date: Thu, 21 Mar 2024 15:01:20 -0500 Subject: [PATCH 2/3] fix: sync updates user in the db --- src/func/Union.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/func/Union.py b/src/func/Union.py index def3691..5c8866d 100644 --- a/src/func/Union.py +++ b/src/func/Union.py @@ -85,6 +85,7 @@ async def sync(self, ctx, name: str, tag: str = None, is_fs=False): if not ign: return unknown_ign_embed + # Initialize vars for storing changes roles_to_add = [] roles_to_remove = [bot.processing] @@ -100,6 +101,9 @@ async def sync(self, ctx, name: str, tag: str = None, is_fs=False): return embed.add_field(name="Do the above and then enter the following in chat:", value=f"`{str(self.user)}`") + await update_member(discord_id=self.user.id, + uuid=uuid, + username=ign) guild_name = "no guild" if not guild_data else guild_data["name"] can_tag = await has_tag_perms(self.user) From 941754654b0da9a954de507c0b22cfcbef59b1a6 Mon Sep 17 00:00:00 2001 From: "suspendedtundra2@gmail.com" Date: Thu, 21 Mar 2024 16:02:05 -0500 Subject: [PATCH 3/3] fix: fixed registration embed not sending for members --- src/func/Union.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/func/Union.py b/src/func/Union.py index 5c8866d..331baef 100644 --- a/src/func/Union.py +++ b/src/func/Union.py @@ -175,7 +175,6 @@ async def register(self, ctx, name): await insert_new_member(discord_id=self.user.id, uuid=uuid, username=ign) - # Fetch player & guild data guild_data = await get_player_guild(uuid) @@ -262,7 +261,7 @@ async def callback(self, interaction: discord.Interaction): await ctx.author.remove_roles(bot.new_member_role, reason="Register") await ctx.author.edit(nick=ign) - return (embed, guest_ticket) if guild_name != guild_handle else (None, None) + return (embed, guest_ticket) if guild_name != guild_handle else (embed, None) async def add(self, ctx): if ctx.channel.category.name not in ticket_categories.values():