https://github.com/oldes/rebol-irc
Rebol IRC module
https://github.com/oldes/rebol-irc
irc rebol rebol-extension
Last synced: 2 months ago
JSON representation
Rebol IRC module
- Host: GitHub
- URL: https://github.com/oldes/rebol-irc
- Owner: Oldes
- Created: 2023-01-04T10:04:39.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-29T13:44:05.000Z (about 1 year ago)
- Last Synced: 2024-05-02T01:26:53.317Z (about 1 year ago)
- Topics: irc, rebol, rebol-extension
- Language: Rebol
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/Oldes/Rebol-IRC/actions/workflows/main.yml)
# Rebol/IRC
Rebol IRC scheme for [Rebol3](https://github.com/Oldes/Rebol3).
## Basic usage example
This is minimal code, which does not handles reconnection and has almost no command handlers.
```rebol
import %irc.reb
port: make port! [
scheme: 'irc
user: "MyReBot"
real: "My Full Name"
host: "irc.libera.chat"
commands: make map! reduce/no-set [
PRIVMSG: func[ircp cmd][ print ["PRIVMSG:" mold cmd] ]
001 func[ircp cmd][ print "You are connected now!" ]
]
]
open port ;; Initialize the connection
forever [
res: wait [port 30] ;; Wakeup after every 30 seconds
unless open? port [break] ;; Connection was lost, so exit the loop
unless res [
write port 'PING ;; Send PING to server
]
]
```For more complex example see: [irc-test.r3](https://github.com/Oldes/Rebol-IRC/blob/master/irc-test.r3)