From 55504e3071f3538ea66b1229c33ae65fe29f2855 Mon Sep 17 00:00:00 2001 From: janderedev Date: Sat, 30 Apr 2022 11:25:24 +0200 Subject: [PATCH] allow changing api url --- .env.example | 4 ++++ bot/src/index.ts | 3 ++- docker-compose.yml.example | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index c0e2f61..7df25e6 100644 --- a/.env.example +++ b/.env.example @@ -10,6 +10,10 @@ # after initializing the database. DB_PASS= +# Base URL of the Revolt API to connect to. +# Defaults to https://api.revolt.chat +API_URL= + # Your bot account's token. BOT_TOKEN= diff --git a/bot/src/index.ts b/bot/src/index.ts index 48657e0..0771f66 100644 --- a/bot/src/index.ts +++ b/bot/src/index.ts @@ -21,7 +21,8 @@ let client = new AutomodClient({ // pongTimeout: 10, // onPongTimeout: 'RECONNECT', fixReplyCrash: true, - messageTimeoutFix: true + messageTimeoutFix: true, + apiURL: process.env.API_URL, }, db); login(client); diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 0c71ec8..2f6b878 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -23,6 +23,7 @@ services: - BOT_METRICS_MSG_PING_CHANNEL - BOT_STATUS - BOT_STATUS_INTERVAL + - API_URL # Uncomment if you enabled Prometheus metrics #ports: # - 127.0.0.1:${BOT_METRICS_PORT}:${BOT_METRICS_PORT} @@ -53,6 +54,7 @@ services: - DB_STRING=mongodb://mogus:${DB_PASS}@mongo:27017/admin - NODE_ENV=production - BRIDGE_METRICS_PORT + - API_URL # Uncomment if you enabled Prometheus metrics #ports: # - 127.0.0.1:${BRIDGE_METRICS_PORT}:${BRIDGE_METRICS_PORT}