From 71d728fb1aa6960d7abf7a9488c98b1860c3d803 Mon Sep 17 00:00:00 2001 From: Owen Date: Fri, 10 Jan 2025 22:18:27 +0100 Subject: [PATCH] remove no alternatives found text --- lib/plantnet/parser.ex | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/plantnet/parser.ex b/lib/plantnet/parser.ex index cf46817..2604cce 100644 --- a/lib/plantnet/parser.ex +++ b/lib/plantnet/parser.ex @@ -129,9 +129,7 @@ defmodule PlantIdDiscordBot.PlantNet.Parser do end defp get_alternatives(data) do - if length(data) === 0 do - "\n\nNo alternatives found." - else + if length(data) > 0 do alternatives = Enum.map(data, & &1["species"]["scientificNameWithoutAuthor"]) |> Enum.join(", ")