mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2025-01-09 12:55:29 +00:00
logs: highlight bad words
This commit is contained in:
parent
841fe43104
commit
a3514c3f9a
11
cogs/logs.py
11
cogs/logs.py
|
@ -23,6 +23,10 @@ class Logs(Cog):
|
||||||
"goldleaf", "lithium", # title managers
|
"goldleaf", "lithium", # title managers
|
||||||
"nsp", "xci", # "backup" formats
|
"nsp", "xci", # "backup" formats
|
||||||
"nut", "doge", "cdnsp"] # cdn dlers/dumpers
|
"nut", "doge", "cdnsp"] # cdn dlers/dumpers
|
||||||
|
susp_hellgex = "|".join([r"\W*".join(list(word)) for
|
||||||
|
word in self.susp_words])
|
||||||
|
self.susp_hellgex = re.compile(susp_hellgex)
|
||||||
|
|
||||||
self.ok_words = ["nspwn", "hblnsp", "exefs"]
|
self.ok_words = ["nspwn", "hblnsp", "exefs"]
|
||||||
|
|
||||||
@Cog.listener()
|
@Cog.listener()
|
||||||
|
@ -158,8 +162,13 @@ class Logs(Cog):
|
||||||
msg += f"\n\nJump: <{message.jump_url}>"
|
msg += f"\n\nJump: <{message.jump_url}>"
|
||||||
spy_channel = self.bot.get_channel(config.spylog_channel)
|
spy_channel = self.bot.get_channel(config.spylog_channel)
|
||||||
|
|
||||||
|
# Bad Code :tm:, blame retr0id
|
||||||
|
message_clean = message.content.replace("*", "").replace("_", "")
|
||||||
|
regd = self.susp_hellgex.sub(lambda w: "**{}**".format(w.group(0)),
|
||||||
|
message_clean)
|
||||||
|
|
||||||
# Show a message embed
|
# Show a message embed
|
||||||
embed = discord.Embed(description=message.content)
|
embed = discord.Embed(description=regd)
|
||||||
embed.set_author(name=message.author.display_name,
|
embed.set_author(name=message.author.display_name,
|
||||||
icon_url=message.author.avatar_url)
|
icon_url=message.author.avatar_url)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue