Some code refactoring (use of class instead of tuples)
This commit is contained in:
parent
448b455e77
commit
4f0744ab24
8 changed files with 333 additions and 200 deletions
|
@ -154,15 +154,12 @@ class Message:
|
|||
|
||||
|
||||
def parsemsg (self, mods):
|
||||
if re.match(".*(norme|coding style).*", self.content) is not None and re.match(".*(please|give|obtenir|now|plz|stp|svp|s'il (te|vous) pla.t|check).*", self.content) is not None:
|
||||
norme.launch (self.srv.s, self.sender, self.content)
|
||||
|
||||
#Treat all messages starting with 'nemubot:' as distinct commands
|
||||
elif self.content.find("%s:"%self.srv.nick) == 0:
|
||||
if self.content.find("%s:"%self.srv.nick) == 0:
|
||||
messagel = self.content.lower()
|
||||
|
||||
#Is it a simple response?
|
||||
if re.match(".*(m[' ]?entends?[ -]+tu|h?ear me|do you copy|ping).*", messagel) is not None:
|
||||
if re.match(".*(m[' ]?entends?[ -]+tu|h?ear me|do you copy|ping)", messagel) is not None:
|
||||
self.send_chn ("%s: pong"%(self.sender))
|
||||
|
||||
elif re.match(".*di[st] (a|à) ([a-zA-Z0-9_]+) (.+)$", messagel) is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue