feat: add emoji

This commit is contained in:
Paul Makles
2022-07-07 13:23:31 +01:00
parent 386f027a5a
commit a7e0c42ee4
28 changed files with 453 additions and 24 deletions

View File

@@ -0,0 +1,24 @@
use serde::{Deserialize, Serialize};
/// Information about what owns this emoji
#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone)]
#[serde(tag = "type")]
pub enum EmojiParent {
Server { id: String },
}
/// Representation of an Emoji on Revolt
#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone)]
pub struct Emoji {
/// Unique Id
#[serde(rename = "_id")]
pub id: String,
/// What owns this emoji
pub parent: EmojiParent,
/// Uploader user id
pub creator_id: String,
/// Emoji name
pub name: String,
/// Whether the emoji is animated
pub animated: bool,
}

View File

@@ -5,6 +5,7 @@ mod admin {
mod media {
pub mod attachment;
pub mod emoji;
}
mod channels {
@@ -37,6 +38,7 @@ pub use bot::Bot;
pub use channel::Channel;
pub use channel_invite::Invite;
pub use channel_unread::ChannelUnread;
pub use emoji::Emoji;
pub use message::Message;
pub use migrations::MigrationInfo;
pub use server::Server;