Verbetert nummerherkenning
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user