carpjs

1.0.3 • Public • Published

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(" ")}`)
    })
})

Dependents (0)

Package Sidebar

Install

npm i carpjs

Weekly Downloads

13

Version

1.0.3

License

Apache-2.0

Unpacked Size

56.4 kB

Total Files

18

Last publish

Collaborators

  • mackan90096