1.0.10 • Published 3 years ago

node-replit-comment-bot v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
3 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

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago