Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fs.readFile("connectionSettings.json", (err, data) => {
- if (err){
- console.log(err);
- } else {
- channelData = JSON.parse(data);
- options = {
- options: {
- debug: true
- },
- connection: {
- cluster: "aws",
- reconnect: true
- },
- identity: {
- username: channelData[1],
- password: channelData[2]
- },
- channels:[channelData[0]]
- };
- client = new tmi.client(options);
- client.connect();
- }
- })
- client.on("chat", function(channel, userstate, message, self) {
- mainWindow.webContents.send("message:add", userstate.username, message);
- console.log("message");
- })
- function sendMessage(msg) {
- client.say(options.channels[0].replace("#",""), msg)
- }
Add Comment
Please, Sign In to add comment