Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
Deal with steam falling over a bit more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
aquarion committed Apr 1, 2012
1 parent c86efeb commit 40d376a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lampstand/reactions/play.py
Expand Up @@ -56,8 +56,13 @@ def channelAction(self, connection, user, channel, message, matchIndex = False):
## Overuse Detectection ##

matches = self.channelMatch[matchIndex].findall(message)

output = self.respond(user,matchIndex, matches)
output = "%s: %s" % (user, output)

if output:
output = "%s: %s" % (user, output)
else:
output = "%s: Settlers of Catan? Monopoly? Steam's not talking to me right now, sorry." % user

connection.msg(channel, output.encode("utf-8"))

Expand All @@ -79,7 +84,10 @@ def playWhat(self, username, limitToRecent=False):
if result == None:
return self.helptext()

steam = self.getSteamXML(result[0])
try:
steam = self.getSteamXML(result[0])
except:
return False

print steam

Expand All @@ -97,7 +105,10 @@ def setSteam(self, username, result):

steamname = result[0]

steam = self.getSteamXML(steamname)
try:
steam = self.getSteamXML(steamname)
except:
return False

if hasattr(steam, '__getitem__'):
return steam[1]
Expand Down

0 comments on commit 40d376a

Please sign in to comment.