From dddcaceb00f2cba5b0a99b148e5fb5c336cf5894 Mon Sep 17 00:00:00 2001 From: JP Date: Sun, 8 Dec 2019 13:49:34 +0100 Subject: [PATCH] Verbetert verbeterde nummerherkenning --- Chatbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chatbot.py b/Chatbot.py index 793a644..2d7b879 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