From 3e5cf70f9e197d9d4cd921fe25fd1fef13526a6f Mon Sep 17 00:00:00 2001 From: Declan Chidlow Date: Thu, 15 Aug 2024 15:22:06 +0800 Subject: [PATCH] Add support for alternate instances --- .env.example | 4 ++-- bot/src/index.ts | 1 + docker-compose.yml.example | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 12d7026..dfcfab0 100644 --- a/.env.example +++ b/.env.example @@ -11,8 +11,8 @@ DB_PASS= # Base URL of the Revolt API to connect to. -# Defaults to https://api.revolt.chat -API_URL= +# Defaults to https://revolt.chat/api +REVOLT_API_URL= # Your bot account's token. BOT_TOKEN= diff --git a/bot/src/index.ts b/bot/src/index.ts index 8c15845..be175e3 100644 --- a/bot/src/index.ts +++ b/bot/src/index.ts @@ -16,6 +16,7 @@ logger.info('Initializing client'); let db = MongoDB(); let client = new AutomodClient({ autoReconnect: true, + baseURL: process.env['REVOLT_API_URL'] || "https://revolt.chat/api", }, db); login(client); diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 8698363..ab1b679 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -23,7 +23,7 @@ services: - BOT_METRICS_MSG_PING_CHANNEL - BOT_STATUS - BOT_STATUS_INTERVAL - - API_URL + - REVOLT_API_URL # Uncomment if you enabled Prometheus metrics #ports: # - 127.0.0.1:${BOT_METRICS_PORT}:${BOT_METRICS_PORT}