Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.
Open
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: 6 additions & 10 deletions pokeball.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,9 @@ async def cmd_id(self, message, args=[]):
embed = discord.Embed(title="Search Results", description="\u200B", color=15728640)
if results == "\u200B":
continue
else:
for result in results[i:i+10]:
embed.add_field(name=result[0], value=f"**ID**: {result[1]}\n**LEVEL**: {result[2]}", inline=False)
embeds.append(embed)
for result in results[i:i+10]:
embed.add_field(name=result[0], value=f"**ID**: {result[1]}\n**LEVEL**: {result[2]}", inline=False)
embeds.append(embed)
Comment on lines -469 to +471
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PokeBall.cmd_id refactored with the following changes:

try:
base = await message.channel.send(content=None, embed=embeds[0])
pager = Paginator(message, base, embeds, self)
Expand All @@ -492,11 +491,9 @@ async def cmd_id(self, message, args=[]):

async def cmd_duplicates(self, message, args=[]):
pokemons = [pokemon.split(' -> ')[0] for pokemon in self.pokelist]
limit = 2
if args:
limit = int(args[0])
limit = int(args[0]) if args else 2
dups = {dup for dup in pokemons if pokemons.count(dup) >= limit}
if len(dups) == 0:
if not dups:
Comment on lines -495 to +496
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PokeBall.cmd_duplicates refactored with the following changes:

await message.channel.send("There is no pokemon with so many duplicates. Try a smaller number.")
return
dups = list(dups)
Expand Down Expand Up @@ -653,8 +650,7 @@ def bordered(text): # Kudos to xKynn for this.
lines = text.splitlines()
width = max(len(s) for s in lines) + 2
res = ['┌' + '─' * width + '┐']
for s in lines:
res.append('│ ' + (s + ' ' * width)[:width - 1] + '│')
res.extend('│ ' + (s + ' ' * width)[:width - 1] + '│' for s in lines)
Comment on lines -656 to +653
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PokeBall.on_ready.updater.bordered refactored with the following changes:

res.append('└' + '─' * width + '┘')
return '\n'.join(res)

Expand Down