forked from jmug/stoatchat
fix: must not restrict lowerbound for embeds
This commit is contained in:
@@ -495,16 +495,6 @@ impl Channel {
|
|||||||
.replace(replies.into_iter().collect::<Vec<String>>());
|
.replace(replies.into_iter().collect::<Vec<String>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process included embeds.
|
|
||||||
let mut embeds = vec![];
|
|
||||||
for sendable_embed in data.embeds {
|
|
||||||
embeds.push(sendable_embed.into_embed(db, message_id.clone()).await?)
|
|
||||||
}
|
|
||||||
|
|
||||||
if !embeds.is_empty() {
|
|
||||||
message.embeds.replace(embeds);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add attachments to message.
|
// Add attachments to message.
|
||||||
let mut attachments = vec![];
|
let mut attachments = vec![];
|
||||||
if data.attachments.len() > *MAX_ATTACHMENT_COUNT {
|
if data.attachments.len() > *MAX_ATTACHMENT_COUNT {
|
||||||
@@ -524,6 +514,16 @@ impl Channel {
|
|||||||
message.attachments.replace(attachments);
|
message.attachments.replace(attachments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Process included embeds.
|
||||||
|
let mut embeds = vec![];
|
||||||
|
for sendable_embed in data.embeds {
|
||||||
|
embeds.push(sendable_embed.into_embed(db, message_id.clone()).await?)
|
||||||
|
}
|
||||||
|
|
||||||
|
if !embeds.is_empty() {
|
||||||
|
message.embeds.replace(embeds);
|
||||||
|
}
|
||||||
|
|
||||||
// Set content
|
// Set content
|
||||||
message.content = data.content;
|
message.content = data.content;
|
||||||
|
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ pub struct DataMessageSend {
|
|||||||
///
|
///
|
||||||
/// Text embed content contributes to the content length cap
|
/// Text embed content contributes to the content length cap
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
#[validate(length(min = 1, max = 10))]
|
#[validate(length(min = 0, max = 10))]
|
||||||
pub embeds: Vec<SendableEmbed>,
|
pub embeds: Vec<SendableEmbed>,
|
||||||
/// Masquerade to apply to this message
|
/// Masquerade to apply to this message
|
||||||
#[validate]
|
#[validate]
|
||||||
|
|||||||
Reference in New Issue
Block a user