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.
- Host: GitHub
- URL: https://github.com/matheusfillipe/irc.js
- Owner: matheusfillipe
- Created: 2022-05-25T20:15:11.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-25T23:37:18.000Z (about 4 years ago)
- Last Synced: 2025-01-20T21:37:48.450Z (over 1 year ago)
- Topics: irc, webirc, websocket
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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...
```