-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Discord bridge config through env variables
- Loading branch information
1 parent
382d099
commit 8d65f4c
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,12 +43,15 @@ if config_env() == :prod do | |
# There is already a root user, so disable it | ||
config :teiserver, Teiserver.Setup, key: nil | ||
|
||
enable_discord_bridge = Teiserver.ConfigHelpers.get_env("ENABLE_DISCORD_BRIDGE", true, :bool) | ||
|
||
config :teiserver, Teiserver, | ||
game_name: "Beyond All Reason", | ||
game_name_short: "BAR", | ||
main_website: "https://www.beyondallreason.info/", | ||
privacy_email: "[email protected]", | ||
discord: "https://discord.gg/beyond-all-reason", | ||
enable_discord_bridge: enable_discord_bridge, | ||
ports: [ | ||
tcp: Teiserver.ConfigHelpers.get_env("SPRING_TCP_PORT", 8200, :int), | ||
tls: Teiserver.ConfigHelpers.get_env("SPRING_TLS_PORT", 8201, :int), | ||
|
@@ -167,4 +170,19 @@ if config_env() == :prod do | |
format: "$date $time [$level] $metadata $message\n", | ||
metadata: [:request_id, :user_id], | ||
level: :info | ||
|
||
if enable_discord_bridge do | ||
config :nostrum, | ||
gateway_intents: [ | ||
:guilds, | ||
:guild_messages, | ||
:guild_message_reactions, | ||
:direct_messages, | ||
:message_content, | ||
:direct_message_reactions | ||
], | ||
log_full_events: true, | ||
log_dispatch_events: true, | ||
token: Teiserver.ConfigHelpers.get_env("DISCORD_BOT_TOKEN") | ||
end | ||
end |