File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1616
1717allowed_chars_puns = string .ascii_letters + " " + string .digits + "áéíóúàèìòùäëïöü"
1818allowed_chars_triggers = allowed_chars_puns + "^$.*+?(){}\\ []<>=-"
19- version = "0.6.1 "
19+ version = "0.6.2 "
2020required_validations = 5
2121
2222if 'TOKEN' not in os .environ :
@@ -298,13 +298,17 @@ def silence(message):
298298 bot .reply_to (message , 'Missing time to silence or invalid syntax: \" /punsilence "time in minutes"' )
299299 return
300300 if int (quote ) > 60 or not quote .isdigit ():
301- bot .reply_to (message , 'Disabling PunsBot for more than one hour is not funny 😢' )
301+ bot .reply_to (message , 'Disabling PunsBot for more than an hour is not funny 😢' )
302302 return
303303 chatoptions = load_chat_options (message .chat .id )
304304 if chatoptions ['silence' ] is None or int (chatoptions ['silence' ]) <= int (time .time ()):
305305 chatoptions ['silence' ] = 60 * int (quote ) + int (time .time ())
306306 else :
307- chatoptions ['silence' ] = 60 * int (quote ) + int (chatoptions ['silence' ])
307+ if int (chatoptions ['silence' ]) + 60 * int (quote ) - int (time .time ()) >= 3600 :
308+ bot .reply_to (message , 'Disabling PunsBot for more than an hour is not funny 😢' )
309+ return
310+ else :
311+ chatoptions ['silence' ] = 60 * int (quote ) + int (chatoptions ['silence' ])
308312 set_chat_options (chatoptions )
309313 bot .reply_to (message , 'PunsBot will be muted until ' + time .strftime ('%Y-%m-%d %H:%M:%S' , time .localtime (chatoptions ['silence' ])))
310314
You can’t perform that action at this time.
0 commit comments