From 80658929931f400ffb1a7ce7c91ea1926db2f8f9 Mon Sep 17 00:00:00 2001 From: flaree Date: Tue, 28 Jan 2025 12:17:24 +0000 Subject: [PATCH 1/5] Change message if have to request approval --- ballsdex/packages/balls/cog.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ballsdex/packages/balls/cog.py b/ballsdex/packages/balls/cog.py index 1d8dd1c9..e2575e93 100644 --- a/ballsdex/packages/balls/cog.py +++ b/ballsdex/packages/balls/cog.py @@ -609,10 +609,16 @@ async def give( countryball.description(short=True, include_emoji=True, bot=self.bot, is_trade=True) + f" (`{countryball.attack_bonus:+}%/{countryball.health_bonus:+}%`)" ) - await interaction.followup.send( - f"You just gave the {settings.collectible_name} {cb_txt} to {user.mention}!", - allowed_mentions=discord.AllowedMentions(users=new_player.can_be_mentioned), - ) + if new_player.donation_policy == DonationPolicy.REQUEST_APPROVAL: + await interaction.followup.send( + f"{interaction.user.mention}, you just gave {settings.collectible_name} {cb_txt} to {user.mention}!", + allowed_mentions=discord.AllowedMentions(users=new_player.can_be_mentioned), + ) + else: + await interaction.followup.send( + f"You just gave the {settings.collectible_name} {cb_txt} to {user.mention}!", + allowed_mentions=discord.AllowedMentions(users=new_player.can_be_mentioned), + ) await countryball.unlock() @app_commands.command() From 00e5c138d23e149b142b0d3d94393249db8f6a76 Mon Sep 17 00:00:00 2001 From: flaree Date: Tue, 28 Jan 2025 12:24:03 +0000 Subject: [PATCH 2/5] fix precommit --- ballsdex/packages/balls/cog.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ballsdex/packages/balls/cog.py b/ballsdex/packages/balls/cog.py index e2575e93..4ebcd609 100644 --- a/ballsdex/packages/balls/cog.py +++ b/ballsdex/packages/balls/cog.py @@ -611,7 +611,8 @@ async def give( ) if new_player.donation_policy == DonationPolicy.REQUEST_APPROVAL: await interaction.followup.send( - f"{interaction.user.mention}, you just gave {settings.collectible_name} {cb_txt} to {user.mention}!", + f"{interaction.user.mention}, you just gave the " + f"{settings.collectible_name} {cb_txt} to {user.mention}!", allowed_mentions=discord.AllowedMentions(users=new_player.can_be_mentioned), ) else: From 3773ecffa94e6cf9100492f6be163399fcf454bf Mon Sep 17 00:00:00 2001 From: flaree Date: Mon, 10 Feb 2025 13:06:09 +0000 Subject: [PATCH 3/5] Update to favourite ball --- ballsdex/packages/balls/cog.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ballsdex/packages/balls/cog.py b/ballsdex/packages/balls/cog.py index 4ebcd609..86c25c17 100644 --- a/ballsdex/packages/balls/cog.py +++ b/ballsdex/packages/balls/cog.py @@ -529,7 +529,8 @@ async def give( ephemeral=True, ) return - if countryball.favorite: + favorite = countryball.favorite + if favorite: view = ConfirmChoiceView( interaction, accept_message=f"{settings.collectible_name.title()} donated.", @@ -609,7 +610,7 @@ async def give( countryball.description(short=True, include_emoji=True, bot=self.bot, is_trade=True) + f" (`{countryball.attack_bonus:+}%/{countryball.health_bonus:+}%`)" ) - if new_player.donation_policy == DonationPolicy.REQUEST_APPROVAL: + if favorite: await interaction.followup.send( f"{interaction.user.mention}, you just gave the " f"{settings.collectible_name} {cb_txt} to {user.mention}!", From 167bfb06495b53c4150a65a8623a83a0709afdba Mon Sep 17 00:00:00 2001 From: flaree Date: Mon, 10 Feb 2025 13:10:32 +0000 Subject: [PATCH 4/5] Update mentions --- ballsdex/packages/balls/cog.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ballsdex/packages/balls/cog.py b/ballsdex/packages/balls/cog.py index 86c25c17..b74b8b5e 100644 --- a/ballsdex/packages/balls/cog.py +++ b/ballsdex/packages/balls/cog.py @@ -611,10 +611,15 @@ async def give( + f" (`{countryball.attack_bonus:+}%/{countryball.health_bonus:+}%`)" ) if favorite: + mentions = [] + if new_player.can_be_mentioned: + mentions.append(new_player.discord_id) + if old_player.can_be_mentioned: + mentions.append(old_player.discord_id) await interaction.followup.send( f"{interaction.user.mention}, you just gave the " f"{settings.collectible_name} {cb_txt} to {user.mention}!", - allowed_mentions=discord.AllowedMentions(users=new_player.can_be_mentioned), + allowed_mentions=discord.AllowedMentions(users=mentions), ) else: await interaction.followup.send( From 7406aaf2006b6d75163b7703ca5b74b45eea3151 Mon Sep 17 00:00:00 2001 From: flaree Date: Mon, 10 Feb 2025 13:11:11 +0000 Subject: [PATCH 5/5] update mentions --- ballsdex/packages/balls/cog.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ballsdex/packages/balls/cog.py b/ballsdex/packages/balls/cog.py index b74b8b5e..b64a9a99 100644 --- a/ballsdex/packages/balls/cog.py +++ b/ballsdex/packages/balls/cog.py @@ -610,12 +610,12 @@ async def give( countryball.description(short=True, include_emoji=True, bot=self.bot, is_trade=True) + f" (`{countryball.attack_bonus:+}%/{countryball.health_bonus:+}%`)" ) + mentions = [] + if new_player.can_be_mentioned: + mentions.append(new_player.discord_id) + if old_player.can_be_mentioned: + mentions.append(old_player.discord_id) if favorite: - mentions = [] - if new_player.can_be_mentioned: - mentions.append(new_player.discord_id) - if old_player.can_be_mentioned: - mentions.append(old_player.discord_id) await interaction.followup.send( f"{interaction.user.mention}, you just gave the " f"{settings.collectible_name} {cb_txt} to {user.mention}!", @@ -624,7 +624,7 @@ async def give( else: await interaction.followup.send( f"You just gave the {settings.collectible_name} {cb_txt} to {user.mention}!", - allowed_mentions=discord.AllowedMentions(users=new_player.can_be_mentioned), + allowed_mentions=discord.AllowedMentions(users=mentions), ) await countryball.unlock()