An open API service indexing awesome lists of open source software.

https://github.com/matheusfillipe/irc.js

Tiny simple irc client for the browser using webscoket. It can be used for unrealircd with websocket module or with my ws2irc bridge.
https://github.com/matheusfillipe/irc.js

irc webirc websocket

Last synced: over 1 year ago
JSON representation

Tiny simple irc client for the browser using webscoket. It can be used for unrealircd with websocket module or with my ws2irc bridge.

Awesome Lists containing this project

README

          

# irc.js

## Example usage

Add to the head of the document:

```html

```

Use it like this:

```javascript
// You can change these defaults
// WsIrcClient.default_username = 'username'
// WsIrcClient.default_nick_prefix = 'web-'

let irc_client = new WsIrcClient({
server: "irc.someircwebsocket.com",
port: 7669,
is_ssl: true,
debug: true
})
.onmessage(function (channel, from, message) {
console.log(`${channel} -> ${from}: ${message}`)
this.send(channel, "${from}: I'm running on someone's browser")
})
.onconnect(function () {
this.join(irc_channel)
this.send(channel, "Hello folks!")
})
.onjoin(function (channel) {
console.log(`Joined ${channel}`)
})
.onpart(function (channel) {
console.log(`Leaving ${channel}`)
})
.onnames(function (channel, names) {
console.log(channel + " - Names: " + names.join(" "))
})
.onnickinuse(function () {
console.log("That nickname is already in use!")
})
.onnickchange(function (nick) {
console.log(`You are now know as: ${nick}`)
})
.connect()

// You can keep using client methods from here...
```