diff --git a/Chatbot.py b/Chatbot.py index 4898dd9..793a644 100644 --- a/Chatbot.py +++ b/Chatbot.py @@ -40,7 +40,7 @@ class Chatbot(object): if message.content.lower() == "lol": yield from message.channel.send("laffing aut laut") return - if re.match("^[0-9][0-9.,]*$", message.content.strip()) and random.randint(0,9) == 0: + if re.match("^[0-9]*([,.]?[0-9]+)?$", message.content.strip()) and random.randint(0,9) == 0: yield from message.channel.send("That's Numberwang!") # https://www.youtube.com/watch?v=0obMRztklqU return if "DMChannel" in type(message.channel).__name__: #respond to messages in PM channels