safesupport-bot/src/index.js

47 lines
941 B
JavaScript
Raw Normal View History

2020-03-16 03:30:00 +00:00
require('dotenv').config()
2020-02-23 18:58:09 +00:00
2020-04-22 05:35:34 +00:00
const ENCRYPTION_CONFIG = { algorithm: "m.megolm.v1.aes-sha2" };
const KICK_REASON = "A facilitator has already joined this chat.";
const BOT_ERROR_MESSAGE =
"Something went wrong on our end, please restart the chat and try again.";
const MAX_RETRIES = 3;
2020-04-22 05:35:34 +00:00
const {
MATRIX_SERVER_URL,
BOT_USERNAME,
BOT_USERID,
BOT_PASSWORD,
BOT_DISPLAY_NAME,
FACILITATOR_ROOM_ID,
2020-06-11 13:43:20 +00:00
CAPTURE_TRANSCRIPTS,
CHAT_NOT_AVAILABLE_MESSAGE,
MAX_WAIT_TIME,
2020-09-06 05:20:50 +00:00
MAX_INACTIVE,
2020-04-22 05:35:34 +00:00
} = process.env;
const botConfig = {
ENCRYPTION_CONFIG,
KICK_REASON,
BOT_ERROR_MESSAGE,
MAX_RETRIES,
MATRIX_SERVER_URL,
BOT_USERNAME,
BOT_USERID,
BOT_PASSWORD,
BOT_DISPLAY_NAME,
FACILITATOR_ROOM_ID,
2020-06-11 13:43:20 +00:00
CAPTURE_TRANSCRIPTS,
CHAT_NOT_AVAILABLE_MESSAGE,
MAX_WAIT_TIME,
2020-09-06 05:20:50 +00:00
MAX_INACTIVE,
2020-04-22 05:35:34 +00:00
}
2020-03-16 03:30:00 +00:00
import OcrccBot from './bot'
2020-02-23 18:58:09 +00:00
2020-04-22 05:35:34 +00:00
const bot = new OcrccBot(botConfig);
try {
bot.start();
} catch(err) {
console.log("AAAAAAAAAAAAA", err)
}