forked from MarseyWorld/MarseyWorld
fix muting
parent
13a6243496
commit
b59056fd16
|
@ -43,7 +43,7 @@ sub_regex = re.compile('(^|\s|<p>)\/?(h\/(\w|-){3,25})(?![^<]*<\/(code|pre|a)>)'
|
||||||
|
|
||||||
strikethrough_regex = re.compile('(^|\s|>)~{1,2}([^~]+)~{1,2}', flags=re.A)
|
strikethrough_regex = re.compile('(^|\s|>)~{1,2}([^~]+)~{1,2}', flags=re.A)
|
||||||
|
|
||||||
mute_regex = re.compile("/mute @([a-z0-9_\-]{3,25}) ([0-9])+", flags=re.A)
|
mute_regex = re.compile("\/mute @([a-z0-9_\-]{3,25}) ([0-9])+", flags=re.A|re.I)
|
||||||
|
|
||||||
emoji_regex = re.compile(f"<p>\s*(:[!#@]{{0,3}}[{valid_username_chars}]+:\s*)+<\/p>", flags=re.A)
|
emoji_regex = re.compile(f"<p>\s*(:[!#@]{{0,3}}[{valid_username_chars}]+:\s*)+<\/p>", flags=re.A)
|
||||||
emoji_regex2 = re.compile(f'(?<!"):([!#@{valid_username_chars}]{{1,36}}?):', flags=re.A)
|
emoji_regex2 = re.compile(f'(?<!"):([!#@{valid_username_chars}]{{1,36}}?):', flags=re.A)
|
||||||
|
|
|
@ -79,7 +79,7 @@ def speak(data, v):
|
||||||
if v.admin_level > 1:
|
if v.admin_level > 1:
|
||||||
text = text.lower()
|
text = text.lower()
|
||||||
for i in mute_regex.finditer(text):
|
for i in mute_regex.finditer(text):
|
||||||
username = i.group(1)
|
username = i.group(1).lower()
|
||||||
duration = int(int(i.group(2)) * 60 + time.time())
|
duration = int(int(i.group(2)) * 60 + time.time())
|
||||||
muted[username] = duration
|
muted[username] = duration
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue