1.0.10 • Published 2 years ago

node-replit-comment-bot v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Node Replit Comment Bot

import Bot from 'node-replit-comment-bot'
// Open your secrets tab and set SID to your connect.sid cookie
const bot = new Bot(process.env.SID)

// Ping is the command
bot.on('ping', (comment) => {
	// Do whatever here
	bot.reply(comment.parent.id, `Pong!`) // You have to reply to the first comment in the chain
})

bot.start() // Start the bot

The comment object will look like this:

{
	id: Int,
	user: String,
	body: String,
 	command: String,
	args: [String],
	repl: {
		id: String,
		title: String,
		description: String,
		user: String
	},
	parent: {
		id: Int,
		user: String,
		body: String,
		replies: [{
			id: Int,
			user: String,
			body: String,
		}]
	}
}

You can do this to handle all comments

bot.on('*', (comment) => {
	
})
1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago