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 #8 from ExtraRandom/master
Browse files Browse the repository at this point in the history
!steamstatus
  • Loading branch information
David Jetelina authored and David Jetelina committed May 18, 2016
2 parents 79424e8 + 7944af4 commit 8a021fc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cogs/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,24 @@ async def rd(self):

await s.destructmsg("```"+msg+"```", 30, self.bot)

@commands.command(description=desc.ss, brief=desc.ss)
async def steamstatus(self):
with aiohttp.ClientSession() as session:
async with session.get('http://is.steam.rip/api/v1/?request=SteamStatus')as resp:
data = await resp.json()
if str(data["result"]["success"]) == "True":
ses = ("**Session Logon:** " + data["result"]["SteamStatus"]["services"]["SessionsLogon"] + "\n")
com = ("**Steam Community:** " + data["result"]["SteamStatus"]["services"]["SteamCommunity"] + "\n")
eco = ("**Steam Economy:** " + data["result"]["SteamStatus"]["services"]["IEconItems"] + "\n")
# lead = ("Leaderboards: " + data["result"]["SteamStatus"]["services"]["LeaderBoards"] + "\n")

header = "__**Steam Status**__\n\n"
reply = header + ses + com + eco
else:
reply = "Failed - Error: " + data["result"]["error"]

await s.destructmsg(reply, 30, self.bot)


def rd_calc(rd):

Expand Down
1 change: 1 addition & 0 deletions descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
time_ny = "Checks local time in New York and it's GMT position"
time_sf = "Checks local time in San Francisco and it's GMT position"
rd = "List of games and countdown till their releases"
ss = "Check Status of Steam Servers"

"""
STATS
Expand Down

0 comments on commit 8a021fc

Please sign in to comment.