Skip to content

Commit

Permalink
Added @onerror to all telegram commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
natfarleydev committed Jan 16, 2017
1 parent e651fd6 commit 3e36430
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions beards/natrailenq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,19 @@ async def searchStats(self, msg):
out, other = natRail.searchStations(out)
await self.sender.sendMessage(out)

@onerror
async def getStatus(self, msg):
natRail = NatRail.RailScraper(config.rail_url, config.stat_codes)
output = natRail.getStatus()
await self.sender.sendMessage(output, parse_mode="Markdown")

@onerror
async def getDisruptions(self, msg):
natRail = NatRail.RailScraper(config.rail_url, config.stat_codes)
output = natRail.getNews(msg['text'].replace('/disruptions ','').replace('/disruptions',''))
await self.sender.sendMessage(output, parse_mode="Markdown")

@onerror
async def checkTimes(self, msg):
natRail = NatRail.RailScraper(config.rail_url, config.stat_codes)
out = msg['text'].replace('/departures ','')
Expand Down

0 comments on commit 3e36430

Please sign in to comment.