pub struct ContentSafeOptions { /* private fields */ }
Expand description
Struct that allows to alter content_safe
’s behaviour.
Implementations§
Source§impl ContentSafeOptions
impl ContentSafeOptions
pub fn new() -> Self
Sourcepub fn clean_role(self, b: bool) -> Self
pub fn clean_role(self, b: bool) -> Self
content_safe
will replace role mentions (<@&{id}>
) with its name prefixed with @
(@rolename
) or with @deleted-role
if the identifier is invalid.
Sourcepub fn clean_user(self, b: bool) -> Self
pub fn clean_user(self, b: bool) -> Self
If set to true, content_safe
will replace user mentions (<@!{id}>
or <@{id}>
) with
the user’s name prefixed with @
(@username
) or with @invalid-user
if the identifier
is invalid.
Sourcepub fn clean_channel(self, b: bool) -> Self
pub fn clean_channel(self, b: bool) -> Self
If set to true, content_safe
will replace channel mentions (<#{id}>
) with the
channel’s name prefixed with #
(#channelname
) or with #deleted-channel
if the
identifier is invalid.
Sourcepub fn show_discriminator(self, b: bool) -> Self
pub fn show_discriminator(self, b: bool) -> Self
If set to true, if content_safe
replaces a user mention it will add their four digit
discriminator with a preceding #
, turning @username
to @username#discriminator
.
This option is ignored if the username is a next-gen username, and therefore does not have a discriminator.
Sourcepub fn display_as_member_from<G: Into<GuildId>>(self, guild: G) -> Self
pub fn display_as_member_from<G: Into<GuildId>>(self, guild: G) -> Self
If set, content_safe
will replace a user mention with the user’s display name in passed
guild
.
Sourcepub fn clean_here(self, b: bool) -> Self
pub fn clean_here(self, b: bool) -> Self
If set, content_safe
will replace @here
with a non-pinging alternative.
Sourcepub fn clean_everyone(self, b: bool) -> Self
pub fn clean_everyone(self, b: bool) -> Self
If set, content_safe
will replace @everyone
with a non-pinging alternative.
Trait Implementations§
Source§impl Clone for ContentSafeOptions
impl Clone for ContentSafeOptions
Source§fn clone(&self) -> ContentSafeOptions
fn clone(&self) -> ContentSafeOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more