Skip to content

Commit

Permalink
[trade] changing ball to countryball/settings.collectible_name (#369)
Browse files Browse the repository at this point in the history
* changing ball to countryball and settings.collectible_name

* removing return await for code consistency

* changing ball to countryball again

* more return await and grammar changes

* reverting unnecessary changes

---------

Co-authored-by: MAX <[email protected]>
  • Loading branch information
imtherealF1 and ltzmax authored Aug 31, 2024
1 parent df14d50 commit 5e6e1ee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
16 changes: 8 additions & 8 deletions ballsdex/packages/trade/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ async def add(
async def bulk_add(
self,
interaction: discord.Interaction,
ball: BallEnabledTransform | None = None,
countryball: BallEnabledTransform | None = None,
shiny: bool | None = None,
special: SpecialEnabledTransform | None = None,
):
Expand All @@ -228,7 +228,7 @@ async def bulk_add(
Parameters
----------
ball: Ball
countryball: Ball
The countryball you would like to filter the results to
shiny: bool
Filter the results to shinies
Expand All @@ -248,8 +248,8 @@ async def bulk_add(
)
return
filters = {}
if ball:
filters["ball"] = ball
if countryball:
filters["ball"] = countryball
if shiny:
filters["shiny"] = shiny
if special:
Expand All @@ -276,10 +276,10 @@ async def bulk_add(

view = BulkAddView(interaction, balls, self) # type: ignore
await view.start(
content="Select the countryballs you want to add to your proposal, "
"note that the display will wipe on pagination however "
"the selected countryballs will remain.\n"
"Countryballs were rounded down to closest 25 for "
content=f"Select the {settings.collectible_name}s you want to add to your proposal,"
" note that the display will wipe on pagination however "
f"the selected {settings.collectible_name}s will remain.\n"
f"{settings.collectible_name.title()}s were rounded down to closest 25 for "
"display purposes, final page may be missing entries."
)

Expand Down
7 changes: 5 additions & 2 deletions ballsdex/packages/trade/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ async def confirm_button(self, interaction: discord.Interaction, button: Button)

if len(self.balls_selected) == 0:
return await interaction.followup.send(
f"You have not selected any {settings.collectible_name}s to add to your proposal.",
f"You have not selected any {settings.collectible_name}s "
"to add to your proposal.",
ephemeral=True,
)
for ball in self.balls_selected:
Expand All @@ -451,8 +452,10 @@ async def confirm_button(self, interaction: discord.Interaction, button: Button)
)
trader.proposal.append(ball)
await ball.lock_for_trade()
grammar = "" if len(self.balls_selected) == 1 else "s"
await interaction.followup.send(
f"{len(self.balls_selected)} {settings.collectible_name}s added to your proposal.",
f"{len(self.balls_selected)} {settings.collectible_name}"
f"{grammar} added to your proposal.",
ephemeral=True,
)
self.balls_selected.clear()
Expand Down

0 comments on commit 5e6e1ee

Please sign in to comment.