forked from owenconti/livecodingtv-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (24 loc) · 933 Bytes
/
index.js
File metadata and controls
29 lines (24 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
/**
* LCTV Bot :)
*/
const credentials = require('./setup/custom/credentials');
const Brain = require('./utils/Brain');
const ChatBot = require('./utils/ChatBot');
// Build the initial runtime object
let runtime = require('./utils/Runtime');
runtime.debug = process.argv[2] === 'debug' || false;
runtime.coreCommands = null;
runtime.pluginCommands = null;
runtime.websocketCommands = null;
runtime.startUpTime = new Date().getTime();
runtime.credentials = credentials;
runtime.brain = Brain;
// Verify credentials exist
if ( !runtime.credentials.username || !runtime.credentials.room || !runtime.credentials.password || !runtime.credentials.jid || !runtime.credentials.roomJid ) {
console.error('ERROR: Credentials file is missing required attributes. Please check your credentials.js');
console.log('[bot] Quitting startup process.');
return;
}
runtime.brain.start( __dirname + "/brain" );
ChatBot.start();