mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2024-12-23 07:15:34 +00:00
logs: Add do_nickcheck (unused rn)
This commit is contained in:
parent
4a762bbafd
commit
62b57f4fdb
12
cogs/logs.py
12
cogs/logs.py
|
@ -14,6 +14,7 @@ class Logs:
|
|||
self.bot = bot
|
||||
self.invite_re = re.compile(r"((discord\.gg|discordapp\.com/"
|
||||
r"+invite)/+[a-zA-Z0-9-]+)")
|
||||
self.name_re = re.compile(r"[a-zA-Z0-9].*")
|
||||
|
||||
async def on_member_join(self, member):
|
||||
await self.bot.wait_until_ready()
|
||||
|
@ -85,6 +86,17 @@ class Logs:
|
|||
spy_channel = self.bot.get_channel(config.spylog_channel)
|
||||
await spy_channel.send(msg)
|
||||
|
||||
async def do_nickcheck(self, message):
|
||||
compliant = self.name_re.fullmatch(message.author.display_name)
|
||||
if compliant:
|
||||
return
|
||||
|
||||
msg = f"R11 violating name by {message.author.mention} "\
|
||||
f"({message.author.id})."
|
||||
|
||||
spy_channel = self.bot.get_channel(config.spylog_channel)
|
||||
await spy_channel.send(msg)
|
||||
|
||||
async def on_message(self, message):
|
||||
await self.bot.wait_until_ready()
|
||||
if message.channel.id not in config.spy_channels:
|
||||
|
|
Loading…
Reference in a new issue