Skip to content

A friendly IRC bot, eager to give you fortune cookies.

License

Notifications You must be signed in to change notification settings

jsynacek/lambda-irc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

𝛌irc

A friendly IRC bot, eager to give you fortune cookies.

Installation

$ git clone https://github.com/jsynacek/lambda-irc.git
$ cd lambda-irc
$ stack install

The program is installed to $HOME/.local/bin/ by default.

Usage

Cookies are loaded from $HOME/.fortunes, one cookie per line. If that file cannot be read for some reason, several hard-coded cookies are provided by default.

$ lambda-irc
< parsed irc message stream incoming ... >

Afterwards, any PRIVMSG starting with the string !fortune sent directly to the bot will yield a fortune cookie.

Command dispatch

Limited control of the bot is available via a unix socket at /tmp/lambda-irc.sock.

Recognized commands

These are the recognized commands. Their arguments are specified as described in RFC1459, see <params>.

  • /mesg
  • /join
  • /part
  • /quit

Example

The following is an example usage of the command dispatch using nc. The blank lines are not part of the session, they are added for clarity.

$ nc -U /tmp/lambda-irc.sock

Give me a cookie!
unknown command: Give me a cookie!

/join #haskell-beginners
<no output, bot joins the channel>

/mesg #haskell-beginners :Hi, I'm worth a fortune!
<no output, bot sends a message to the channel>

/part #haskell-beginners
<no output, bot leaves the channel>

/quit :I'm tired...
<no output, bot disconnects from the server>

TBI

Extend the program to accept an additional command !dict which would use a web-based dictionary and display translations.

For example, !dict en cz fortune might use https://slovnik.seznam.cz/en-cz/?q=fortune and display something like:

(small) fortune (celé) jmění, spousta peněz, majlant
(good) fortune štěstí přízeň osudu
fortunes úspěchy, zdary
štěstěna
tell sb's fortune věštit komu osud z dlaně ap.

About

A friendly IRC bot, eager to give you fortune cookies.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published