mirror of
https://github.com/TheRealOwenRees/plantid-discord-bot.git
synced 2026-07-23 04:26:57 +00:00
fixed missing api base url env
This commit is contained in:
+9
-8
@@ -1,15 +1,16 @@
|
||||
import Config
|
||||
|
||||
config :plantid_discord_bot,
|
||||
image_path: "priv/static",
|
||||
max_results: 5,
|
||||
score_threshold: 0.3,
|
||||
plantnet_api_key: System.get_env("PLANTNET_API_KEY"),
|
||||
plantnet_api_base_url: "https://my-api.plantnet.org/v2",
|
||||
score_threshold: 0.3,
|
||||
max_results: 5
|
||||
|
||||
config :plantid_discord_bot, PlantIdDiscordBot.Scheduler,
|
||||
jobs: [
|
||||
{"@daily", {PlantIdDiscordBot.RateLimiter, :reset_counters, []}}
|
||||
]
|
||||
port: 4321,
|
||||
guild_request_limit_per_day: 20,
|
||||
image_path: "priv/static",
|
||||
fileserver_url: "http://localhost:4321",
|
||||
source: "https://github.com/TheRealOwenRees/plantid-discord-bot",
|
||||
invite:
|
||||
"https://discord.com/api/oauth2/authorize?client_id=948227126094598204&permissions=19520&scope=bot"
|
||||
|
||||
import_config "#{config_env()}.exs"
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
import Config
|
||||
|
||||
config :plantid_discord_bot,
|
||||
guild_request_limit_per_day: 20,
|
||||
guild_ids: [1_002_507_312_159_797_318],
|
||||
plantnet_api_key: System.get_env("PLANTNET_API_KEY"),
|
||||
plantnet_api_base_url: "https://my-api.plantnet.org/v2",
|
||||
fileserver_url: "http://localhost:4321",
|
||||
port: 4321,
|
||||
source: "https://github.com/TheRealOwenRees/plantid-discord-bot",
|
||||
invite:
|
||||
"https://discord.com/api/oauth2/authorize?client_id=948227126094598204&permissions=19520&scope=bot",
|
||||
api: Nostrum.Api
|
||||
|
||||
config :logger, :console,
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
import Config
|
||||
|
||||
config :plantid_discord_bot,
|
||||
guild_request_limit_per_day: 20,
|
||||
guild_ids: [],
|
||||
plantnet_api_key: System.get_env("PLANTNET_API_KEY"),
|
||||
fileserver_url: "http://localhost:4321",
|
||||
port: 4321,
|
||||
source: "https://github.com/TheRealOwenRees/plantid-discord-bot",
|
||||
invite:
|
||||
"https://discord.com/api/oauth2/authorize?client_id=948227126094598204&permissions=19520&scope=bot",
|
||||
api: Nostrum.Api
|
||||
|
||||
config :logger,
|
||||
|
||||
+13
-3
@@ -3,13 +3,23 @@ import Config
|
||||
config :plantid_discord_bot,
|
||||
start_time: DateTime.utc_now(),
|
||||
guild_ids: [1_002_507_312_159_797_318],
|
||||
api: Nostrum.Api,
|
||||
max_results: 5,
|
||||
score_threshold: 0.3,
|
||||
plantnet_api_key: System.get_env("PLANTNET_API_KEY"),
|
||||
fileserver_url: "http://localhost:4321",
|
||||
plantnet_api_base_url: "https://my-api.plantnet.org/v2",
|
||||
port: 4321,
|
||||
guild_request_limit_per_day: 20,
|
||||
image_path: "priv/static",
|
||||
fileserver_url: "http://localhost:4321",
|
||||
source: "https://github.com/TheRealOwenRees/plantid-discord-bot",
|
||||
invite:
|
||||
"https://discord.com/api/oauth2/authorize?client_id=948227126094598204&permissions=19520&scope=bot",
|
||||
api: Nostrum.Api
|
||||
"https://discord.com/api/oauth2/authorize?client_id=948227126094598204&permissions=19520&scope=bot"
|
||||
|
||||
config :plantid_discord_bot, PlantIdDiscordBot.Scheduler,
|
||||
jobs: [
|
||||
{"@daily", {PlantIdDiscordBot.RateLimiter, :reset_counters, []}}
|
||||
]
|
||||
|
||||
config :nostrum,
|
||||
token: System.get_env("DISCORD_TOKEN"),
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
import Config
|
||||
|
||||
config :plantid_discord_bot,
|
||||
guild_request_limit_per_day: 20,
|
||||
guild_ids: [1_002_507_312_159_797_318],
|
||||
plantnet_api_key: System.get_env("PLANTNET_API_KEY"),
|
||||
fileserver_url: "http://localhost:4321",
|
||||
port: 4321,
|
||||
source: "https://github.com/TheRealOwenRees/plantid-discord-bot",
|
||||
invite:
|
||||
"https://discord.com/api/oauth2/authorize?client_id=948227126094598204&permissions=19520&scope=bot",
|
||||
api: PlantIdDiscordBotTest.Mocks.Nostrum.Api
|
||||
|
||||
config :logger, :console,
|
||||
|
||||
@@ -52,8 +52,10 @@ defmodule PlantIdDiscordBot.Cog.PlantNet do
|
||||
cleanup_saved_images(saved_images)
|
||||
rescue
|
||||
e ->
|
||||
Logger.error(Exception.format(:error, e, __STACKTRACE__))
|
||||
|
||||
Api.create_followup_message(interaction.application_id, interaction.token, %{
|
||||
content: e.message
|
||||
content: "An error occurred. This error has been logged."
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,8 +13,10 @@ defmodule PlantidDiscordBot.MixProject do
|
||||
|
||||
# Run "mix help compile.app" to learn about applications.
|
||||
def application do
|
||||
dev_apps = if Mix.env() == :dev, do: [:observer, :wx], else: []
|
||||
|
||||
[
|
||||
extra_applications: [:logger, :observer, :wx, :runtime_tools],
|
||||
extra_applications: [:logger, :runtime_tools] ++ dev_apps,
|
||||
mod: {PlantIdDiscordBot.Application, []}
|
||||
]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user