use crate::AttachmentKind;
use alux_sdk::case_mapping;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Take {
Everything,
Videos,
Images,
}
case_mapping! {
Take, &'static str as &str,
Everything <=> "everything",
Videos <=> "video",
Images <=> "images",
}
impl Take {
#[must_use]
pub const fn summary(self) -> &'static str {
match self {
Self::Everything => {
"takes every file the tweet carries, good for keeping the whole post"
}
Self::Videos => "takes the videos only, good for clips",
Self::Images => "takes the pictures only, good for photographs",
}
}
#[must_use]
pub const fn accepts(self, kind: AttachmentKind) -> bool {
match self {
Self::Everything => true,
Self::Videos => matches!(kind, AttachmentKind::Video | AttachmentKind::Animation),
Self::Images => matches!(kind, AttachmentKind::Photo),
}
}
}