joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
728 stars 244 forks source link

wildcard commands - mentioned #51

Closed e0xify closed 8 years ago

e0xify commented 8 years ago

Hi all,

is there a way to wildcard a string? so if there is some name like "karsten" in the message, that it will react. something with ? or *

("^karsten*", self.hs)

thanks

x23piracy commented 8 years ago

Hi,

just googled...

message = message.getFrom()
if "karsten" in message.lower(): 
    continue

Source: http://stackoverflow.com/questions/3437059/does-python-have-a-string-contains-substring-method

Regards X23

e0xify commented 8 years ago

allright, thanks... but where to implement that? this needs to be checked in every message, so i have no idea where to add it...