Skip to content

Commit

Permalink
[trade] change donation message if favourite cb (#528)
Browse files Browse the repository at this point in the history
* Change message if have to request approval

* fix precommit

* Update to favourite ball

* Update mentions

* update mentions
  • Loading branch information
flaree authored Feb 10, 2025
1 parent 25a0aa4 commit d0e37a0
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions ballsdex/packages/balls/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -609,10 +610,22 @@ 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),
)
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:
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=mentions),
)
else:
await interaction.followup.send(
f"You just gave the {settings.collectible_name} {cb_txt} to {user.mention}!",
allowed_mentions=discord.AllowedMentions(users=mentions),
)
await countryball.unlock()

@app_commands.command()
Expand Down

0 comments on commit d0e37a0

Please sign in to comment.