Skip to content

Commit afa71c8

Browse files
committed
some doc fixes
1 parent 3a581de commit afa71c8

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

Diff for: globals.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ class Globals():
88
GIF_URL = 'http://www.pokestadium.com/sprites/xy/'
99
S_GIF_URL = 'http://www.pokestadium.com/sprites/xy/shiny/'
1010
DEX_URL = 'http://cdn.bulbagarden.net/upload/thumb/3/36/479Rotom-Pok%C3%A9dex.png/160px-479Rotom-Pok%C3%A9dex.png'
11+
S_ICON = '<:i_shiny:309407527001522177>'
1112

1213

1314
TYPE_DICT = {'bug': '<:t_bug:308684134585335808>', 'dark': '<:t_dark:308684134677610496>',

Diff for: pokedex.py

+9-12
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ def __init__(self, bot):
1717
self.lock = False
1818

1919
DEX_USAGE = "Pokémon must be from Gen I - VI\n" \
20-
"```Usage: !dex [pkmn # or name]\n" \
21-
"e.g: !dex 151 / !dex mew```"
20+
"```Args :\n" \
21+
"Random Pokémon -r / -random\n" \
22+
"Shiny Pokémon -s / -shiny\n\n" \
23+
"Usage: !dex [p1] / '-r' ('-s')\n" \
24+
"e.g: !dex 151 / !dex mew\n" \
25+
" !dex -random -shiny```"
2226

2327
@commands.command(pass_context=True)
2428
async def dex(self, ctx, *args):
@@ -70,18 +74,11 @@ async def dex(self, ctx, *args):
7074
pkmn_type = {i['type']['name'] for i in pt}
7175
print("Displaying Pokemon {0} #{1}".format(pkmn_name, pkmn_id))
7276

73-
# if '-s' not in args[1:] and '-shiny' not in args[1:]:
74-
# try:
75-
# s = str(pkmn_name)
76-
# trans = str.maketrans('', '', punctuation)
77-
# filename = ''.join((g.GIF_URL, s.translate(trans), '.gif'))
78-
# a = urlopen(filename)
79-
# except HTTPError:
80-
# filename = ''.join((g.IMG_URL, str(pkmn_id), '.png'))
81-
# else: filename = ''.join((g.IMG_URL, 'shiny/' ,str(pkmn_id), '.png'))
82-
8377
filename = self.get_thumbnail(pkmn_id, pkmn_name, shiny=shiny)
78+
8479
type_emojis = ' '.join({g.TYPE_DICT[t] for t in pkmn_type if t in g.TYPE_DICT})
80+
if shiny: type_emojis += g.S_ICON
81+
8582
title = "{0} #{1} {2}".format(pkmn_name.capitalize(), pkmn_id, type_emojis)
8683
sub_title = "the {0} Pokémon".format(pkmn_genus)
8784

0 commit comments

Comments
 (0)