mirror of
https://github.com/TheRealOwenRees/plantid-discord-bot.git
synced 2026-07-23 04:26:57 +00:00
Feature/diseases (#19)
* add disease photo options * basic disease application command, no real parsing other than map to string
This commit is contained in:
@@ -30,6 +30,18 @@ defmodule PlantIdDiscordBot.PlantNet.Parser do
|
||||
@powo_base_url "https://powo.science.kew.org/taxon"
|
||||
@score_threshold Application.compile_env(:plantid_discord_bot, :score_threshold)
|
||||
|
||||
def parse_disease_response(response) do
|
||||
response
|
||||
|> to_map!()
|
||||
|> filter_by_score()
|
||||
|> generate_disease_response_message()
|
||||
end
|
||||
|
||||
def generate_disease_response_message(data) do
|
||||
data
|
||||
|> to_string()
|
||||
end
|
||||
|
||||
@doc """
|
||||
Parses the response from the PlantNet API into a map.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user