1.0.4 • Published 6 years ago

carp-irc v1.0.4

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
6 years ago

Carp

A JS IRC library

Install using npm install carpjs

More documentation is available as a JSDoc here

Example usage:

To connect to a server, create a client using the Carp.Client interface;

const client = new Carp.Client({
	username: "MyBot"
})

Then, connect to a server;

client.connect("irc.freenode.net", 6667)

When the client has logged in, join a channel;

client.on("ready", () => {
	client.join("#mychannel")
})

When the client joins the channel, you can get the channel and respond to messages;

client.on("join", data => {
	const channel = data.channel

	channel.on('message', (from, message) => {
		channel.sendMessage(`${from.info.nick} said ${message.join(" ")}`)
	})
})