carpjs
v1.0.3
Published
An extensive irc library for node.js.
Downloads
13
Maintainers
Readme
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(" ")}`)
})
})