Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from ExtraRandom/master
Browse files Browse the repository at this point in the history
1.0.1.1
  • Loading branch information
David Jetelina authored and David Jetelina committed Jun 6, 2016
2 parents 40f9359 + c52472c commit fa6eb57
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion cogs/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(self, bot):

# Dates have to be in relation to UTC (so if release is 5am BST, it would be 4am UTC)
self.dates = {
"Hearts of Iron 4": datetime(2016, 6, 6, 0, 0, 0),
"No Man''s Sky": datetime(2016, 8, 12, 0, 0, 0),
"Deus Ex: Mankind Divided": datetime(2016, 8, 23, 0, 0, 0),
"Battlefield 1": datetime(2016, 10, 21, 0, 0, 0),
Expand All @@ -27,6 +26,8 @@ def __init__(self, bot):
"Mirror''s Edge: Catalyst": datetime(2016, 6, 9, 0, 0, 0),
"Mafia III": datetime(2016, 10, 7, 0, 0, 0),
"Pokemon Sun and Moon": datetime(2016, 11, 23, 0, 0, 0),
"World of Warcraft: Legion": datetime(2016, 8, 30, 0, 0, 0),
"Mighty No. 9": datetime(2016, 6, 21, 0, 0, 0),
}

@commands.command(description=desc.reddit, brief=desc.reddit)
Expand Down
19 changes: 9 additions & 10 deletions cogs/overwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

class Overwatch:
def __init__(self, bot):
"""
Edit self.dates with releases we want to track
"""
self.bot = bot

@commands.command(description=desc.ow, brief=desc.owb)
Expand Down Expand Up @@ -46,7 +43,7 @@ async def overwatch(self, region: str, battletag: str):
res.raise_for_status()
except Exception as e:
await self.bot.edit_message(msg, "**Error with request. Please check for mistakes before trying again.**"
".\nError: "+str(e))
".\nError: {}".format(str(e)))
log.exception("Error with request")
return

Expand All @@ -66,13 +63,15 @@ async def overwatch(self, region: str, battletag: str):
games_lost = int(games_played) - int(games_won)
won_lost = "{}/{}".format(games_won, games_lost)

await self.bot.edit_message(msg, "**Overwatch Stats for {} - {}**\n\n"
"Time Played: *{}*\n"
"Total Games: *{}*\n"
"Games Won/Lost: *{}*\n"
"Most Played Hero: *{}, {} played*"
win_percent = round(((games_won / games_played) * 100), 1)

await self.bot.edit_message(msg, "**Overwatch Stats for {0} - {1}**\n\n"
"Time Played: *{2}*\n"
"Total Games: *{3}*\n"
"Games Won/Lost: *{4}* ({7}% win rate)\n"
"Most Played Hero: *{5}, {6} played*"
"".format(battletag, reg.upper(), time_played, games_played,
won_lost, most_played, most_games))
won_lost, most_played, most_games, win_percent))


def find_value(stats, name):
Expand Down
6 changes: 6 additions & 0 deletions cogs/versioning/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ Changelog
* Everything up to this point is only found in commits
* [!version][] says bot's version out loud
* [!changelog][] whispers caller last changes

1.0.1.1
-------
* Overwatch Command now also displays a players win rate as a percentage
* [!release][] Removed Hearts of Iron 4 from list
* [!release][] Added Mighty No. 9 and WoW: Legion to list
** **
2 changes: 1 addition & 1 deletion cogs/versioning/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1.0
1.0.1.1

0 comments on commit fa6eb57

Please sign in to comment.