mirror of
https://github.com/TheRealOwenRees/plantid-discord-bot.git
synced 2026-07-23 04:26:57 +00:00
add static analysis tool Dialyzer
This commit is contained in:
@@ -41,7 +41,7 @@ defmodule PlantIdDiscordBot.Cog.PlantNet do
|
||||
attachment_urls = get_attachment_urls(interaction)
|
||||
original_images = get_original_images(attachment_urls)
|
||||
|
||||
# FUNCTION return image filename list as a list of images to delete
|
||||
# FUNCTION return image filename list as a list of images to delete
|
||||
saved_images =
|
||||
try do
|
||||
File.download_and_save_files!(attachment_urls)
|
||||
@@ -99,7 +99,7 @@ defmodule PlantIdDiscordBot.Cog.PlantNet do
|
||||
})
|
||||
end
|
||||
|
||||
# TODO delete saved images
|
||||
# TODO delete saved images, make into a task
|
||||
end
|
||||
|
||||
defp get_attachment_urls(interaction) do
|
||||
|
||||
@@ -56,8 +56,9 @@ defmodule PlantIdDiscordBot.FileServer.File do
|
||||
|> File.read()
|
||||
end
|
||||
|
||||
@spec delete_file!(String.t()) :: :ok
|
||||
def delete_file!(filename) do
|
||||
# TODO make into a task for async deletion
|
||||
@spec delete_files!([String.t()]) :: :ok
|
||||
def delete_files!(filename) do
|
||||
File.rm!(Path.join(@image_path, filename))
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user