use twilight_model::{
channel::message::{AllowedMentions, Component, Embed, MessageFlags},
http::attachment::Attachment,
};
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Reply {
pub(crate) content: String,
pub(crate) embeds: Vec<Embed>,
pub(crate) components: Vec<Component>,
pub(crate) attachments: Vec<Attachment>,
pub(crate) flags: MessageFlags,
#[allow(clippy::option_option)]
pub(crate) allowed_mentions: Option<Option<AllowedMentions>>,
pub(crate) tts: bool,
}
impl Default for Reply {
fn default() -> Self {
Self::new()
}
}
impl Reply {
#[must_use]
pub const fn new() -> Self {
Self {
content: String::new(),
embeds: vec![],
components: vec![],
attachments: vec![],
flags: MessageFlags::empty(),
allowed_mentions: None,
tts: false,
}
}
#[must_use]
#[allow(clippy::missing_const_for_fn)]
pub fn content(mut self, content: String) -> Self {
self.content = content;
self
}
#[must_use]
pub fn embed(mut self, embed: Embed) -> Self {
self.embeds.push(embed);
self
}
#[must_use]
pub fn component(mut self, component: Component) -> Self {
self.components.push(component);
self
}
#[must_use]
pub fn attachment(mut self, attachment: Attachment) -> Self {
self.attachments.push(attachment);
self
}
#[must_use]
#[allow(clippy::missing_const_for_fn)]
pub fn ephemeral(mut self) -> Self {
self.flags = MessageFlags::EPHEMERAL;
self
}
#[must_use]
#[allow(clippy::missing_const_for_fn)]
pub fn allowed_mentions(mut self, allowed_mentions: Option<AllowedMentions>) -> Self {
self.allowed_mentions = Some(allowed_mentions);
self
}
#[must_use]
#[allow(clippy::missing_const_for_fn)]
pub fn tts(mut self) -> Self {
self.tts = true;
self
}
}