Struct serenity::builder::CreateAllowedMentions [−][src]
Expand description
A builder to manage the allowed mentions on a message,
used by the ChannelId::send_message
method.
Examples
use serenity::builder::ParseValue;
// Mention only the user 110372470472613888
m.allowed_mentions(|am| {
am.empty_parse();
am.users(vec![110372470472613888])
});
// Mention all users and the role 182894738100322304
m.allowed_mentions(|am| {
am.parse(ParseValue::Users);
am.roles(vec![182894738100322304])
});
// Mention all roles and nothing else
m.allowed_mentions(|am| {
am.parse(ParseValue::Roles)
});
// Mention all roles and users, but not everyone
m.allowed_mentions(|am| {
am.parse(ParseValue::Users);
am.parse(ParseValue::Roles)
});
// Mention everyone and the users 182891574139682816, 110372470472613888
m.allowed_mentions(|am| {
am.parse(ParseValue::Everyone);
am.users(vec![182891574139682816, 110372470472613888])
});
// Mention everyone and the message author.
m.allowed_mentions(|am| {
am.parse(ParseValue::Everyone);
am.users(vec![msg.author.id])
});
Tuple Fields
0: HashMap<&'static str, Value>
Implementations
Add a value that’s allowed to be mentioned.
If users or roles is specified, Self::users
and Self::roles
will not work.
If you use either, do not specify it’s same type here.
Clear all the values that would be mentioned.
If parse is empty, the message will not mention anyone, unless they are specified on
Self::users
or Self::roles
.
Sets the users that will be allowed to be mentioned.
Makes users unable to be mentioned.
Sets the roles that will be allowed to be mentioned.
Makes roles unable to be mentioned.
Makes the reply mention/ping the user.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for CreateAllowedMentions
impl Send for CreateAllowedMentions
impl Sync for CreateAllowedMentions
impl Unpin for CreateAllowedMentions
impl UnwindSafe for CreateAllowedMentions
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more