rewuite to use async
This commit is contained in:
435
src/bot.js
435
src/bot.js
File diff suppressed because it is too large
Load Diff
35
src/index.js
35
src/index.js
@@ -1,6 +1,39 @@
|
||||
require('dotenv').config()
|
||||
|
||||
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;
|
||||
const {
|
||||
MATRIX_SERVER_URL,
|
||||
BOT_USERNAME,
|
||||
BOT_USERID,
|
||||
BOT_PASSWORD,
|
||||
BOT_DISPLAY_NAME,
|
||||
FACILITATOR_GROUP_ID,
|
||||
FACILITATOR_ROOM_ID,
|
||||
CHAT_OFFLINE_MESSAGE,
|
||||
CAPTURE_TRANSCRIPTS
|
||||
} = 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_GROUP_ID,
|
||||
FACILITATOR_ROOM_ID,
|
||||
CHAT_OFFLINE_MESSAGE,
|
||||
CAPTURE_TRANSCRIPTS
|
||||
}
|
||||
|
||||
import OcrccBot from './bot'
|
||||
|
||||
const bot = new OcrccBot();
|
||||
const bot = new OcrccBot(botConfig);
|
||||
bot.start();
|
||||
|
||||
Reference in New Issue
Block a user