Messaging: Parse mentions.

This commit is contained in:
Paul
2021-06-11 18:07:37 +01:00
parent 0f18a6781d
commit 78c890aa59
6 changed files with 23 additions and 2 deletions

View File

@@ -59,10 +59,12 @@ pub struct Message {
pub edited: Option<DateTime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub embeds: Option<Vec<Embed>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub mentions: Option<Vec<String>>
}
impl Message {
pub fn create(author: String, channel: String, content: Content) -> Message {
pub fn create(author: String, channel: String, content: Content, mentions: Option<Vec<String>>) -> Message {
Message {
id: Ulid::new().to_string(),
nonce: None,
@@ -73,6 +75,7 @@ impl Message {
attachments: None,
edited: None,
embeds: None,
mentions
}
}