replchat.js
Advanced tools
Comparing version 1.2.1 to 1.2.2
20
index.js
@@ -27,3 +27,2 @@ const EventEmitter = require('events').EventEmitter | ||
"X-Replit-User-Name": this.username | ||
// "Cookie": `REPL_AUTH=${auth}` | ||
} | ||
@@ -37,6 +36,3 @@ }); | ||
this.socket.on('debug', (code) => { | ||
if (code == "REQUIRES_IDENTIFY") | ||
this.socket.emit('identify', `${this.username} [BOT]`) | ||
this.emit('debug', code) | ||
if (code != "REQUIRES_IDENTIFY") this.socket.emit('identify', `${this.username} [BOT]`) | ||
}) | ||
@@ -50,3 +46,8 @@ | ||
if (this.last != 'joined.' + data.username) { | ||
this.emit('join', data.username) | ||
var user = { | ||
username: data.username, | ||
bot: data.username.endsWith('[BOT]') | ||
} | ||
this.emit('join', user) | ||
this.last = 'joined.' + data.username | ||
@@ -58,3 +59,8 @@ } | ||
if (this.last != 'left.' + data.username) { | ||
this.emit('left', data.username) | ||
var user = { | ||
username: data.username, | ||
bot: data.username.endsWith('[BOT]') | ||
} | ||
this.emit('left', user) | ||
this.last = 'left.' + data.username | ||
@@ -61,0 +67,0 @@ } |
{ | ||
"name": "replchat.js", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "A library for making bots with replchat (https://replchat.bddy.repl.co/)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5906
85