Skip to content

Commit

Permalink
Update currency.py
Browse files Browse the repository at this point in the history
Stops the "TypeError: expected string or buffer (source unknown)" error when typing .cur and having no arguments supplied.

Quite the issue in my channel, apparently.
  • Loading branch information
HarinderToor committed Apr 9, 2014
1 parent b354dad commit 63e9b2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def get_rate(code):
@example('.cur 20 EUR in USD')
def exchange(bot, trigger):
"""Show the exchange rate between two currencies"""
if not trigger.group(2):
return bot.reply("No search term. An example: .cur 20 EUR in USD")
match = regex.match(trigger.group(2))
if not match:
# It's apologetic, because it's using Canadian data.
Expand Down

0 comments on commit 63e9b2f

Please sign in to comment.