File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33from discord .ext import commands
44
55PATTERN = re .compile (
6- r"\b(\w*)(ise|isation|isations|ising|ised|ises|iser|isers )\b" ,
6+ r"\b(\w*)(ize|ization|izations|izing|ized|izes|izer|izers )\b" ,
77 re .IGNORECASE ,
88)
99IGNORED_CATEGORY_IDS = [1031955833371758754 ]
@@ -20,7 +20,7 @@ def cog_check(self, ctx):
2020
2121 def _correct_text (self , match ):
2222 prefix , suffix = match .groups ()
23- return f"*{ prefix } { suffix .replace ('is ' , 'iz ' )} "
23+ return f"*{ prefix } { suffix .replace ('iz ' , 'is ' )} "
2424
2525 @commands .Cog .listener ()
2626 async def on_message (self , message ):
@@ -30,8 +30,8 @@ async def on_message(self, message):
3030 return
3131 if message .channel .category_id in IGNORED_CATEGORY_IDS :
3232 return
33- if "proctor " in message .content .casefold () and random .random () < 0.05 :
34- await message .channel .send ("*invigilator " )
33+ if "invigilator " in message .content .casefold () and random .random () < 0.05 :
34+ await message .channel .send ("*proctor " )
3535 for match in PATTERN .finditer (message .content ):
3636 await message .channel .send (self ._correct_text (match ))
3737
You can’t perform that action at this time.
0 commit comments