Skip to content

Commit

Permalink
If there's less then "number" events available do not dump an IndexEr…
Browse files Browse the repository at this point in the history
…ror to the channel.
  • Loading branch information
chotee committed Jan 12, 2017
1 parent a42f534 commit fbf5e1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spaceevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ def getevents(bot, number):
botmessage = ""
for stuff in eventfinallevel:
print(str(stuff))
bot.say(stuff[0] + " - " + stuff[1])
try:
bot.say(stuff[0] + " - " + stuff[1])
except IndexError:
break

@willie.module.commands('nextevents')
@willie.module.example('.nextevents','nextevents')
Expand Down

0 comments on commit fbf5e1b

Please sign in to comment.