Skip to content

Commit

Permalink
Merge pull request #169 from MiscGuild/Registration-fix
Browse files Browse the repository at this point in the history
Registration fix
  • Loading branch information
Amxgh authored Mar 17, 2024
2 parents adf301a + 535f8b8 commit 0488338
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/func/Union.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ async def sync(self, ctx, name: str, tag: str = None, is_fs=False):
return embed

async def register(self, ctx, name):
await ctx.defer()
# Make sure it is only used in registration channel
if ctx.channel.id != registration_channel_id:
return "This command can only be used in the registration channel!", None
Expand Down Expand Up @@ -183,7 +184,6 @@ async def register(self, ctx, name):

# User is in an allied guild
elif guild_name in allies:
await ctx.defer()
await ctx.author.add_roles(bot.guest, bot.ally, reason="Registration - Ally")

# Add guild tag as nick
Expand All @@ -194,7 +194,6 @@ async def register(self, ctx, name):

# User is a guest
else:
await ctx.defer()
await ctx.author.add_roles(bot.processing, reason="Registration - Processing")
ticket = await create_ticket(ctx.author, f"ticket-{ign}",
category_name=ticket_categories["registrees"])
Expand Down
2 changes: 1 addition & 1 deletion src/utils/referral_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def generate_rank_upgrade(weekly_invites : list):
# A player gets 7 entries for every valid invite they have made
total_invitations = 0
for uuid, invitations in weekly_invites:
entries[uuid] = entries[uuid] + (len(invitations)*7) if uuid in entries else (len(invitations)*7)
entries[uuid] = entries[uuid] + (len(invitations) * 12) if uuid in entries else (len(invitations) * 12)
total_invitations += len(invitations)

weighted_entries = [uuid for uuid, weight in entries.items() for _ in range(weight)]
Expand Down
1 change: 1 addition & 0 deletions src/utils/request_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ async def get_mojang_profile(name: str):
# If player and request is valid
if resp and ("errorMessage" not in resp) and ("name" in resp):
return resp["name"], resp["id"]

api_key = await get_hyapi_key()
resp = await get_json_response(f"https://api.hypixel.net/player?key={api_key}&name={name}")
if resp and 'player' in resp and resp['player']:
Expand Down

0 comments on commit 0488338

Please sign in to comment.