mirror of
https://github.com/TheRealOwenRees/plantid-discord-bot.git
synced 2026-07-23 04:26:57 +00:00
groundwork for custom request limits, with 10 requests now standard
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ import Config
|
|||||||
config :plantid_discord_bot,
|
config :plantid_discord_bot,
|
||||||
max_results: 5,
|
max_results: 5,
|
||||||
score_threshold: 0.3,
|
score_threshold: 0.3,
|
||||||
guild_request_limit_per_day: 20,
|
guild_request_limit_per_day: 10,
|
||||||
image_path: "priv/static",
|
image_path: "priv/static",
|
||||||
plantnet_api_base_url: "https://my-api.plantnet.org/v2",
|
plantnet_api_base_url: "https://my-api.plantnet.org/v2",
|
||||||
source: "https://github.com/TheRealOwenRees/plantid-discord-bot",
|
source: "https://github.com/TheRealOwenRees/plantid-discord-bot",
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ defmodule PlantIdDiscordBot.RateLimiter do
|
|||||||
|
|
||||||
@request_limit Application.compile_env(:plantid_discord_bot, :guild_request_limit_per_day)
|
@request_limit Application.compile_env(:plantid_discord_bot, :guild_request_limit_per_day)
|
||||||
|
|
||||||
|
@custom_limits %{
|
||||||
|
1_002_507_312_159_797_318 => 100,
|
||||||
|
689_135_063_849_500_726 => 50,
|
||||||
|
900_886_202_226_462_730 => 50
|
||||||
|
}
|
||||||
|
|
||||||
def start_link(_) do
|
def start_link(_) do
|
||||||
GenServer.start_link(__MODULE__, nil, name: __MODULE__)
|
GenServer.start_link(__MODULE__, nil, name: __MODULE__)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user