diff --git a/backend/config/initializers/discord.rb b/backend/config/initializers/discord.rb index 1909cf9..a468a1a 100644 --- a/backend/config/initializers/discord.rb +++ b/backend/config/initializers/discord.rb @@ -12,12 +12,13 @@ def method_missing(*_args) else $discord = DiscordRequest.new(bot_token: ENV["DISCORD_BOT_TOKEN"]) - begin - info = $discord.get("/users/@me") - rescue StandardError - Rails.logger.error("Discord: Failed to log in, disabling") - $discord = Disabled.new - end + info = + begin + $discord.get("/users/@me") + rescue StandardError + Rails.logger.error("Discord: Failed to log in, disabling") + $discord = Disabled.new + end Rails.logger.info( "Discord: Logged in as #{info[:username]}##{info[:discriminator]}"