Skip to content

Commit

Permalink
Discord bridge config through env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
geekingfrog committed Apr 28, 2024
1 parent 382d099 commit 8d65f4c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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

0 comments on commit 8d65f4c

Please sign in to comment.