diff options
| author | Simponic <loganhunt@simponic.xyz> | 2023-02-01 14:57:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-01 14:57:14 -0700 |
| commit | fe5f5b77fcc3ef24516866561f9b54ac07663ad6 (patch) | |
| tree | ba63998ec306983d87594195d60ecb0abb6ea5d1 /config | |
| parent | 324d041d5c5cbcdf0083dcd802144a57443789f6 (diff) | |
| download | chessh-fe5f5b77fcc3ef24516866561f9b54ac07663ad6.tar.gz chessh-fe5f5b77fcc3ef24516866561f9b54ac07663ad6.zip | |
Discord notifs (#14)
* Add role id to config
* Add discord notifications for games
* Fix discord discriminant tests
Diffstat (limited to 'config')
| -rw-r--r-- | config/config.exs | 9 | ||||
| -rw-r--r-- | config/runtime.exs | 5 |
2 files changed, 13 insertions, 1 deletions
diff --git a/config/config.exs b/config/config.exs index c19937a..e732049 100644 --- a/config/config.exs +++ b/config/config.exs @@ -14,13 +14,20 @@ config :chessh, RateLimits, player_session_message_burst_rate: 8, player_public_keys: 15, create_game_ms: 60 * 1000, - create_game_rate: 3 + create_game_rate: 3, + discord_notification_rate: 3, + discord_notification_rate_ms: 1000 config :chessh, Web, discord_oauth_login_url: "https://discord.com/api/oauth2/token", discord_user_api_url: "https://discord.com/api/users/@me", discord_scope: "identify" +config :chessh, DiscordNotifications, + game_move_notif_delay_ms: 3 * 60 * 1000, + game_created_notif_delay_ms: 30 * 1000, + reschedule_delay: 5 * 1000 + config :joken, default_signer: "secret" import_config "#{config_env()}.exs" diff --git a/config/runtime.exs b/config/runtime.exs index 5e03614..684e48e 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -3,6 +3,11 @@ import Config config :chessh, ssh_port: String.to_integer(System.get_env("SSH_PORT", "34355")) +config :chessh, DiscordNotifications, + looking_for_games_role_mention: "<@&#{System.get_env("NEW_GAME_PINGABLE_ROLE_ID")}>", + discord_game_move_notif_webhook: System.get_env("REMIND_MOVE_CHANNEL_WEBHOOK"), + discord_new_game_notif_webhook: System.get_env("NEW_GAME_CHANNEL_WEBHOOK") + config :chessh, Web, discord_client_id: System.get_env("DISCORD_CLIENT_ID"), discord_client_secret: System.get_env("DISCORD_CLIENT_SECRET"), |
