storage: make constructors more idiomatic

This commit is contained in:
seth 2024-03-03 18:06:40 -05:00
parent 46fd02605f
commit 651f14d724
No known key found for this signature in database
GPG key ID: D31BD0D494BBEE86
5 changed files with 44 additions and 85 deletions

View file

@ -13,7 +13,7 @@ static MESSAGE_PATTERN: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"/(https?:\/\/)?(?:canary\.|ptb\.)?discord(?:app)?\.com\/channels\/(?<serverId>\d+)\/(?<channelId>\d+)\/(?<messageId>\d+)/g;").unwrap()
});
pub fn find_first_image(msg: &Message) -> Option<String> {
fn find_first_image(msg: &Message) -> Option<String> {
msg.attachments
.iter()
.find(|a| {