refluxer 0.2.0

Rust API wrapper for Fluxer
Documentation
use serde::Deserialize;

use crate::model::id::EmojiId;
use crate::model::user::User;

/// Lightweight emoji reference carried by gateway reaction payloads. A custom
/// guild emoji has a non-None `id`; a Unicode emoji has `id == None` and a
/// `name` like "🔥".
#[derive(Debug, Clone, Deserialize)]
pub struct PartialEmoji {
    pub id: Option<EmojiId>,
    pub name: Option<String>,
    #[serde(default)]
    pub animated: bool,
}

/// Full guild emoji object returned by REST endpoints.
#[derive(Debug, Clone, Deserialize)]
pub struct Emoji {
    pub id: EmojiId,
    pub name: String,
    #[serde(default)]
    pub animated: bool,
    /// Present on responses that include authorship info
    /// (e.g. `list_guild_emojis`, `create_guild_emoji`).
    #[serde(default)]
    pub user: Option<User>,
}