Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes #150

Merged
merged 4 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cogs/staff.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def inactive(self, ctx):
)
async def forcesync(self, ctx, member: discord.Member, name: str):
"""Update a user's discord nick, tag and roles for them!"""
res = await Union(user=member).sync(ctx, name, None, True)
res = await Union(user=ctx.guild.get_member(member.id)).sync(ctx, name, None, True)
if isinstance(res, discord.Embed):
await ctx.respond(embed=res)
elif isinstance(res, str):
Expand Down
4 changes: 2 additions & 2 deletions src/func/General.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ async def new(ctx):
async def partner(ctx, organization_name: str):
await ctx.send("In one message, please provide a brief description of the guild/organization being partnered.")
# Wait for description
description = (await bot.wait_for("message", check=lambda x: x.author == ctx.message.author)).content
description = (await bot.wait_for("message", check=lambda x: x.author == ctx.author)).content

await ctx.send(
"Please provide the logo of the organization/guild. (Please provide the URL. If they don't have a logo, type `None`)")
# Wait for Logo
response = (await bot.wait_for("message", check=lambda x: x.author == ctx.message.author)).content
response = (await bot.wait_for("message", check=lambda x: x.author == ctx.author)).content
logo = response if not response.lower() == "none" else None

if logo:
Expand Down
33 changes: 12 additions & 21 deletions src/func/Union.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,22 @@ async def register(self, ctx, name):

guild_name = "Guildless" if not guild_data else guild_data["name"]

embed = discord.Embed(
title="Registration successful!", color=neutral_color)
embed.set_thumbnail(url=f'https://minotar.net/helm/{uuid}/512.png')
embed.add_field(name=ign, value=f"Member of {guild_name}" if guild_name != "Guildless" else "Guildless")



getReference = False
# User is a member
if guild_name == guild_handle:
getReference = True
fields = [
["Who invited you to Miscellaneous on Hypixel?", "Enter NONE if you joined on your own.",
discord.InputTextStyle.short,
"Invited by:"]
]
await ctx.response.send_modal(modal=uiutils.ModalCreator(embed=embed, fields=fields, ign=ign, uuid=uuid, title="Player Reference",
function=validate_reference))
await ctx.author.add_roles(bot.member_role, reason="Registration - Member")


# User is in an allied guild
elif guild_name in allies:
await ctx.author.add_roles(bot.guest, bot.ally, reason="Registration - Ally")
Expand Down Expand Up @@ -254,22 +260,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)

# Send success embed
embed = discord.Embed(
title="Registration successful!", color=neutral_color)
embed.set_thumbnail(url=f'https://minotar.net/helm/{uuid}/512.png')

embed.add_field(name=ign, value=f"Member of {guild_name}")
if getReference:

fields = [
["Who invited you to Miscellaneous on Hypixel?", "Enter NONE if you joined on your own.", discord.InputTextStyle.short,
"Invited by:"]
]
await ctx.response.send_modal(
modal=uiutils.ModalCreator(embed=embed, fields=fields, ign=ign, uuid=uuid,title="Player Reference", function=validate_reference))
else:
return embed
return embed if guild_name != guild_handle else None

async def add(self, ctx):
if ctx.channel.category.name not in ticket_categories.values():
Expand Down
2 changes: 1 addition & 1 deletion src/utils/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
registration_embed = discord.Embed(title=f"Welcome to the {guild_handle} Discord!",
description="Before you can view the server, please register with your Minecraft username.",
color=neutral_color).add_field(name="To register use the following command:",
value="/register `Your Minecraft Name` `MEMBERS OF MISC: The name of the person who invited you to Miscellaneous`\n\nExample:\n/register John MinecraftPlayer123",
value="/register `Your Minecraft Name`\n\nExample:\n/register John",
inline=False)

ticket_deleted_embed = discord.Embed(title="Your ticket was deleted!",
Expand Down
Loading