pub struct AllowedMentions {
pub parse: Vec<MentionType>,
pub replied_user: bool,
pub roles: Vec<Id<RoleMarker>>,
pub users: Vec<Id<UserMarker>>,
}
Expand description
Allowed mentions (pings).
Filters mentions to only ping one’s specified here, regardless of the message’s content1.
Mentions can be clicked to reveal additional context, whilst only requiring an ID to create. See Discord Docs/Message Formatting.
AllowedMentions::default
disallows all pings.
Messages must still contain mentions, e.g.
@everyone
! ↩
Fields§
§parse: Vec<MentionType>
List of allowed mention types.
MentionType::Roles
and MentionType::Users
allows all roles and users to be
mentioned; they are mutually exclusive with the roles
and users
fields.
replied_user: bool
For replies, whether to mention the message author.
Defaults to false.
roles: Vec<Id<RoleMarker>>
List of roles to mention.
users: Vec<Id<UserMarker>>
List of users to mention.
Trait Implementations§
source§impl Clone for AllowedMentions
impl Clone for AllowedMentions
source§fn clone(&self) -> AllowedMentions
fn clone(&self) -> AllowedMentions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AllowedMentions
impl Debug for AllowedMentions
source§impl Default for AllowedMentions
impl Default for AllowedMentions
source§fn default() -> AllowedMentions
fn default() -> AllowedMentions
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for AllowedMentions
impl<'de> Deserialize<'de> for AllowedMentions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for AllowedMentions
impl Hash for AllowedMentions
source§impl PartialEq for AllowedMentions
impl PartialEq for AllowedMentions
source§impl Serialize for AllowedMentions
impl Serialize for AllowedMentions
impl Eq for AllowedMentions
impl StructuralPartialEq for AllowedMentions
Auto Trait Implementations§
impl Freeze for AllowedMentions
impl RefUnwindSafe for AllowedMentions
impl Send for AllowedMentions
impl Sync for AllowedMentions
impl Unpin for AllowedMentions
impl UnwindSafe for AllowedMentions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)