ajustement des timers
This commit is contained in:
parent
ea4b562cd7
commit
6c00f08603
3 changed files with 4 additions and 4 deletions
|
@ -32,7 +32,6 @@ bots:
|
|||
'matrix.*irc' : "> {message}\nLes vrais font tourner matrix dans un tmux."
|
||||
'proxmox' : "promox c'est surfait, faut l'autoremove"
|
||||
on_join: 'Unleash the salt'
|
||||
min_time: 120
|
||||
Macron:
|
||||
on_ping:
|
||||
- "PARCE QUE C'EST NOTRE PROJEEEET !"
|
||||
|
@ -41,6 +40,7 @@ bots:
|
|||
'tocard' : "Est-ce que je peux dire autocar ?"
|
||||
'Manu.*\?' : "Tu m’appelles monsieur le président de la République, ou monsieur."
|
||||
'aides sociales' : "Ça coûte un pognon dingue !"
|
||||
min_time: 30 # in seconds
|
||||
Patou:
|
||||
on_ping:
|
||||
- "En parlant de ça, Centrale ne sait vraiment pas travailler en multicampus"
|
||||
|
|
|
@ -19,7 +19,7 @@ class Bot:
|
|||
self.on_join = None
|
||||
self.tg_user_match = re.compile('^<\x03..\x02\x02(?P<username>.+)\x03>')
|
||||
self.ping_match = re.compile('^(<.+> )?\@?{name}'.format(name=nickname))
|
||||
self.min_time = 30
|
||||
self.min_time = 0
|
||||
self.last_time = datetime.datetime(1,1,1)
|
||||
|
||||
def add_reaction(self, match, reaction):
|
||||
|
@ -73,7 +73,7 @@ class Bot:
|
|||
"""
|
||||
if (datetime.datetime.now() - self.last_time).total_seconds() < self.min_time:
|
||||
return []
|
||||
username = username.split('!')[0]
|
||||
username = user.split('!')[0]
|
||||
tg_user_match = self.tg_user_match.match(message)
|
||||
if 'bot' in username.lower() and tg_user_match:
|
||||
username = '@' + tg_user_match.groupdict()['username']
|
||||
|
|
|
@ -29,7 +29,7 @@ class Loader:
|
|||
b.add_python_reaction(match, matches[match])
|
||||
|
||||
b.on_join = template.get('on_join', None)
|
||||
b.min_time = template.get('min_time', 30)
|
||||
b.min_time = template.get('min_time', 20)
|
||||
|
||||
return b
|
||||
|
||||
|
|
Loading…
Reference in a new issue