image saving with basic error handling

This commit is contained in:
Owen
2024-12-16 16:25:38 +01:00
parent 5a5700fab7
commit c04b7f2d22
13 changed files with 116 additions and 9 deletions
+3 -3
View File
@@ -36,14 +36,14 @@ defmodule PlantIdDiscordBot.PlantNet.Parser do
@spec parse(String.t()) :: map()
def parse(response) do
response
|> to_map()
|> to_map!()
|> filter_by_score()
|> add_external_urls()
|> generate_response_message()
end
@spec to_map(String.t()) :: map()
def to_map(response), do: Jason.decode!(response)
@spec to_map!(String.t()) :: map()
def to_map!(response), do: Jason.decode!(response)
@doc """
Filters the data by score. Data is a parsed response from the PlantNet API.