Skip to content

Commit

Permalink
support for usernames with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
elrick97 committed Dec 23, 2021
1 parent 394526b commit 8cf1683
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.secret
__pycache__
__pycache__
workspace.code-workspace
3 changes: 2 additions & 1 deletion Summoner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def __init__(self, profile, stats, nregion):
self.losses = stats[0]['losses']
self.wr = int((self.wins/(self.wins+self.losses)) * 100)
self.emblem = f'https://lolg-cdn.porofessor.gg/img/s/league-icons-v2/160/{self.getEmblemId()}-1.png'
self.opgg_url = f'https://{nregion}.op.gg/summoner/userName={self.name}'
self.opgg_url = f'https://{nregion}.op.gg/summoner/userName={self.name}'.replace(
" ", "%20")

def getEmblemId(self) -> str:
if(self.tier == 'IRON'):
Expand Down
8 changes: 7 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ async def on_ready():


@client.command()
async def whois(ctx, region, id):
async def whois(ctx, *args):
tlist = list(args)
region = tlist[0]
print(region)
del tlist[0]
id = " ".join(tlist)
print(id)
print('command whois called')
res = await riotApi.getSummoner(region, id)
embed = discord.Embed(color=0x71f79f)
Expand Down

0 comments on commit 8cf1683

Please sign in to comment.