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

Fix order/display of IV and CP in Telegram /caught function #5610

Merged
merged 1 commit into from
Sep 22, 2016
Merged
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
4 changes: 2 additions & 2 deletions pokemongo_bot/event_handlers/chat_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ def get_caught(self, chat_id, num, order):

with self.bot.database as conn:
cur = conn.cursor()
cur.execute("SELECT * FROM catch_log ORDER BY " + order + " DESC LIMIT " + str(num))
cur.execute("SELECT pokemon, cp, iv FROM catch_log ORDER BY " + order + " DESC LIMIT " + str(num))
caught = cur.fetchall()
outMsg = ''
if caught:
for x in caught:
outMsg += '*' + x[0] + '* ' + '(_CP:_ ' + str(int(x[2])) + ') (_IV:_ ' + str(x[1]) + ')\n'
outMsg += '*' + x[0] + '* ' + '(_CP:_ ' + str(int(x[1])) + ') (_IV:_ ' + str(x[2]) + ')\n'
self.sendMessage(chat_id=chat_id, parse_mode='Markdown', text="".join(str(outMsg)))
else:
self.sendMessage(chat_id=chat_id, parse_mode='Markdown', text="No Pokemon Caught Yet.\n")
Expand Down