Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

replchat.js

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

replchat.js - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

15

index.js

@@ -5,6 +5,7 @@ const EventEmitter = require('events').EventEmitter

module.exports = class Client extends EventEmitter {
constructor() {
constructor(username) {
// Construct Client
super()
this.username = username
this.socket = {}

@@ -21,3 +22,3 @@

login(auth) {
login() {
// Authenticate with replchat

@@ -27,3 +28,4 @@ this.socket = io(`https://replchat.bddy.repl.co/`, {

extraHeaders: {
"Cookie": `REPL_AUTH=${auth}`
"X-Replit-User-Name": this.username
// "Cookie": `REPL_AUTH=${auth}`
}

@@ -36,2 +38,9 @@ });

this.socket.on('debug', (code) => {
if (code == "REQUIRES_IDENTIFY")
this.socket.emit('identify', `${this.username} [BOT]`)
this.emit('debug', code)
})
this.socket.on('getmessages', () => {

@@ -38,0 +47,0 @@ this.emit('ready')

2

package.json
{
"name": "replchat.js",
"version": "1.1.3",
"version": "1.2.0",
"description": "A library for making bots with replchat (https://replchat.bddy.repl.co/)",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -10,6 +10,5 @@ # About

You will need to get an auth token for your bot, a tutorial will be provided soon
replchat no longer requires an auth token! Instead, you now put your bots
username in as a parameter when constructiong the class. (More details in examples)
## ! WARNING ! Do NOT share your auth token with ANYONE
# Examples

@@ -21,3 +20,3 @@

const bot = new ReplBot()
const bot = new ReplBot("TestBot") // Replace "TestBot" with the name of your bot

@@ -28,3 +27,3 @@ bot.on('ready', () => {

bot.login('your-auth-token')
bot.login()
```

@@ -36,3 +35,3 @@

const bot = new ReplBot()
const bot = new ReplBot("TestBot") // Replace "TestBot" with the name of your bot

@@ -65,3 +64,3 @@ const config = {

bot.login('your-auth-token')
bot.login()
```

@@ -68,0 +67,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc