reply to message and take only first 5 attachments

This commit is contained in:
Owen
2025-01-10 20:03:11 +01:00
committed by Owen Rees
parent e6103df1ae
commit cd65779142
@@ -32,7 +32,8 @@ defmodule PlantIdDiscordBot.Cog.PlantNetMessage do
def do_identification(message) do def do_identification(message) do
saved_images = saved_images =
try do try do
Enum.map(message.attachments, fn attachment -> attachment.url end) Enum.take(message.attachments, 5)
|> Enum.map(fn attachment -> attachment.url end)
|> File.download_and_save_files!() |> File.download_and_save_files!()
rescue rescue
e in ArgumentError -> e in ArgumentError ->