Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot <[email protected]>
  • Loading branch information
flaree and Copilot authored Feb 20, 2025
1 parent 32db1b4 commit fde80ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ballsdex/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ async def is_blocked(self, other_player: "Player") -> bool:
return await Block.filter((Q(player1=self) & Q(player2=other_player))).exists()

async def add_money(self, amount: int) -> int:
if amount <= 0:
raise ValueError("Amount to add must be positive")
self.money += amount
await self.save(update_fields=("money",))
return self.money
Expand Down
6 changes: 3 additions & 3 deletions ballsdex/packages/admin/money.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def balance(self, interaction: discord.Interaction[BallsDexBot], user: dis
player = await Player.get_or_none(discord_id=user.id)
if not player:
await interaction.followup.send(
f"This user has does not have a {settings.bot_name} account.", ephemeral=True
f"This user does not have a {settings.bot_name} account.", ephemeral=True
)
return

Expand All @@ -52,7 +52,7 @@ async def add(
player = await Player.get_or_none(discord_id=user.id)
if not player:
await interaction.followup.send(
f"This user has does not have a {settings.bot_name} account.", ephemeral=True
f"This user does not have a {settings.bot_name} account.", ephemeral=True
)
return

Expand Down Expand Up @@ -90,7 +90,7 @@ async def remove(
player = await Player.get_or_none(discord_id=user.id)
if not player:
await interaction.followup.send(
f"This user has does not have a {settings.bot_name} account.", ephemeral=True
f"This user does not have a {settings.bot_name} account.", ephemeral=True
)
return

Expand Down

0 comments on commit fde80ff

Please sign in to comment.