mirror of
https://github.com/TheRealOwenRees/plantid-discord-bot.git
synced 2026-07-23 04:26:57 +00:00
reply to message and take only first 5 attachments
This commit is contained in:
@@ -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 ->
|
||||||
|
|||||||
Reference in New Issue
Block a user