Struct serenity::model::guild::Emoji [−][src]
#[non_exhaustive]pub struct Emoji { pub animated: bool, pub available: bool, pub id: EmojiId, pub name: String, pub managed: bool, pub require_colons: bool, pub roles: Vec<RoleId>, pub user: Option<User>, }
Expand description
Represents a custom guild emoji, which can either be created using the API, or via an integration. Emojis created using the API only work within the guild it was created in.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct {{ .. }}
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.animated: bool
Expand description
Whether the emoji is animated.
available: bool
Expand description
Whether the emoji can be used. This may be false when the guild loses boosts, reducing the emoji limit.
id: EmojiId
Expand description
The Id of the emoji.
name: String
Expand description
The name of the emoji. It must be at least 2 characters long and can only contain alphanumeric characters and underscores.
managed: bool
Expand description
Whether the emoji is managed via an Integration
service.
require_colons: bool
Expand description
Whether the emoji name needs to be surrounded by colons in order to be used by the client.
roles: Vec<RoleId>
Expand description
A list of Role
s that are allowed to use the emoji. If there are no
roles specified, then usage is unrestricted.
user: Option<User>
Expand description
The user who created the emoji.
Implementations
impl Emoji
[src]
impl Emoji
[src]pub async fn delete<T: AsRef<Cache> + AsRef<Http>>(
&self,
cache_http: T
) -> Result<()>
[src]
pub async fn delete<T: AsRef<Cache> + AsRef<Http>>(
&self,
cache_http: T
) -> Result<()>
[src]Deletes the emoji. This method requires the cache to fetch the guild ID.
Note: The Manage Emojis permission is required.
Examples
Delete a given emoji:
// assuming emoji has been set already match emoji.delete(&ctx).await { Ok(()) => println!("Emoji deleted."), Err(_) => println!("Could not delete emoji.") }
Errors
Returns Error::Http
if the current user lacks permission,
or may return ModelError::ItemMissing
if the emoji is not
in the cache.
pub async fn edit<T: AsRef<Cache> + AsRef<Http>>(
&mut self,
cache_http: T,
name: &str
) -> Result<()>
[src]
pub async fn edit<T: AsRef<Cache> + AsRef<Http>>(
&mut self,
cache_http: T,
name: &str
) -> Result<()>
[src]Edits the emoji by updating it with a new name. This method requires the cache to fetch the guild ID.
Note: The Manage Emojis permission is required.
Errors
Returns Error::Http
if the current user lacks permission,
or if an invalid name is given.
Trait Implementations
impl<'de> Deserialize<'de> for Emoji
[src]
impl<'de> Deserialize<'de> for Emoji
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl From<Emoji> for ReactionType
[src]
impl From<Emoji> for ReactionType
[src]fn from(emoji: Emoji) -> ReactionType
[src]
fn from(emoji: Emoji) -> ReactionType
[src]Performs the conversion.
impl Mentionable for Emoji
[src]
impl Mentionable for Emoji
[src]Auto Trait Implementations
impl RefUnwindSafe for Emoji
impl Send for Emoji
impl Sync for Emoji
impl Unpin for Emoji
impl UnwindSafe for Emoji
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,