import * as db from "./database"; import {config} from "./config"; import {io} from "./http"; import * as irc from "irc"; import * as discord from "discord.js"; var ircClient; var xmppClient; var twitchClient; var discordClient; var liveUsers: Array; var chatIntegration: Array; async function init() { setInterval(updateUsers, 20000); setInterval(updateInteg, 60000); if(config['chat']['discord']['enabled']){ discordClient = new discord.Client(); discordClient.once('ready', ()=>{ console.log('Discord bot ready')}); discordClient.on('message', (msg) => { if(msg['author']['bot']) return; var lu = getUsr(msg['channel']['name'], 'discord') for(var i=0;i) { if(channel === null) return; io.to(channel).emit('MSG', {nick: msg[0], msg: msg[1], room: channel}); } function getCh(usr: string, itype: string): string{ for(var i=0;i{ var list: Array = []; for(var i=0;i