Merge remote-tracking branch 'origin/main' into livekit

This commit is contained in:
Zomatree
2025-05-01 16:42:13 +01:00
8 changed files with 334 additions and 97 deletions

View File

@@ -1,8 +1,6 @@
use std::time::SystemTime;
use fancy_regex::Regex;
use indexmap::{IndexMap, IndexSet};
use once_cell::sync::Lazy;
use revolt_config::config;
#[cfg(feature = "validator")]
@@ -15,15 +13,6 @@ use iso8601_timestamp::Timestamp;
use super::{Channel, Embed, File, Member, MessageWebhook, User, Webhook, RE_COLOUR};
pub static RE_MENTION: Lazy<Regex> =
Lazy::new(|| Regex::new(r"<@([0-9A-HJKMNP-TV-Z]{26})>").unwrap());
pub static RE_ROLE_MENTION: Lazy<Regex> =
Lazy::new(|| Regex::new(r"<%([0-9A-HJKMNP-TV-Z]{26})>|@online|@everyone").unwrap());
pub static RE_BLOCKS: Lazy<Regex> =
Lazy::new(|| Regex::new(r"(?s)(?<!\\)(?:(```.+?(?<!\\)```)|`[^`\n\r]+?(?<!\\)`)").unwrap());
auto_derived_partial!(
/// Message
pub struct Message {
@@ -65,6 +54,7 @@ auto_derived_partial!(
#[serde(skip_serializing_if = "Option::is_none")]
pub mentions: Option<Vec<String>>,
/// Array of role ids mentioned in this message
#[serde(skip_serializing_if = "Option::is_none")]
pub role_mentions: Option<Vec<String>>,
/// Array of message ids this message is replying to
#[serde(skip_serializing_if = "Option::is_none")]