mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -05:00
Output sanitisation (#1942)
* Add output sanitization defaults to context.send Add some common regex filters in redbot.core.utils.common_filters Add a wrapper for ease of use in bot.send_filtered Sanitize ModLog Case's user field (other's considered trusted as moderator input) Sanitize Usernames/Nicks in userinfo command. Santize Usernames in closing of tunnels. * Add documentation
This commit is contained in:
committed by
Toby Harradine
parent
6ebfdef025
commit
77944e195a
@@ -12,6 +12,8 @@ from .checks import mod_or_voice_permissions, admin_or_voice_permissions, bot_ha
|
||||
from redbot.core.utils.mod import is_mod_or_superior, is_allowed_by_hierarchy, get_audit_reason
|
||||
from .log import log
|
||||
|
||||
from redbot.core.utils.common_filters import filter_invites
|
||||
|
||||
_ = Translator("Mod", __file__)
|
||||
|
||||
|
||||
@@ -1321,9 +1323,11 @@ class Mod:
|
||||
if roles is not None:
|
||||
data.add_field(name=_("Roles"), value=roles, inline=False)
|
||||
if names:
|
||||
data.add_field(name=_("Previous Names"), value=", ".join(names), inline=False)
|
||||
val = filter_invites(", ".join(names))
|
||||
data.add_field(name=_("Previous Names"), value=val, inline=False)
|
||||
if nicks:
|
||||
data.add_field(name=_("Previous Nicknames"), value=", ".join(nicks), inline=False)
|
||||
val = filter_invites(", ".join(nicks))
|
||||
data.add_field(name=_("Previous Nicknames"), value=val, inline=False)
|
||||
if voice_state and voice_state.channel:
|
||||
data.add_field(
|
||||
name=_("Current voice channel"),
|
||||
@@ -1334,6 +1338,7 @@ class Mod:
|
||||
|
||||
name = str(user)
|
||||
name = " ~ ".join((name, user.nick)) if user.nick else name
|
||||
name = filter_invites(name)
|
||||
|
||||
if user.avatar:
|
||||
avatar = user.avatar_url
|
||||
|
||||
Reference in New Issue
Block a user