refactor: Update marriage cog to use discord.User instead of discord.Member for user parameters

This commit is contained in:
Slipstream 2025-05-22 21:08:28 -06:00
parent bb0a6e5734
commit 7309767ecb
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -15,7 +15,7 @@ os.makedirs(os.path.dirname(MARRIAGES_FILE), exist_ok=True)
class MarriageView(ui.View):
"""View for marriage proposal buttons"""
def __init__(self, cog: 'MarriageCog', proposer: discord.Member, proposed_to: discord.Member):
def __init__(self, cog: 'MarriageCog', proposer: discord.User, proposed_to: discord.User):
super().__init__(timeout=300.0) # 5-minute timeout
self.cog = cog
self.proposer = proposer
@ -107,7 +107,7 @@ class MarriageCog(commands.Cog):
except Exception as e:
print(f"Error saving marriages: {e}")
async def create_marriage(self, user1: discord.Member, user2: discord.Member) -> Tuple[bool, str]:
async def create_marriage(self, user1: discord.User, user2: discord.User) -> Tuple[bool, str]:
"""Create a new marriage between two users"""
# Check if either user is already married
user1_id = user1.id
@ -206,7 +206,7 @@ class MarriageCog(commands.Cog):
@app_commands.command(name="propose", description="Propose marriage to another user")
@app_commands.describe(user="The user you want to propose to")
async def propose_command(self, interaction: discord.Interaction, user: discord.Member):
async def propose_command(self, interaction: discord.Interaction, user: discord.User):
"""Propose marriage to another user"""
proposer = interaction.user