Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[trade] changing ball to countryball/settings.collectible_name #369

Merged
merged 7 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading