Skip to content
This repository was archived by the owner on Nov 3, 2020. It is now read-only.

Refactor examples/ircbot.ps#3

Open
bl0ckeduser wants to merge 3 commits intodarkf:masterfrom
bl0ckeduser:master
Open

Refactor examples/ircbot.ps#3
bl0ckeduser wants to merge 3 commits intodarkf:masterfrom
bl0ckeduser:master

Conversation

@bl0ckeduser
Copy link
Copy Markdown

Refactored code, added more comments.

@darkf
Copy link
Copy Markdown
Owner

darkf commented Jan 3, 2013

I think this should come after either I re-implement streams/IO in neu or after a complete rewrite. The IRC bot should be pretty modular, commands should be implemented as functions and stored in a command map. The main part should just consist of

defun mainloop is
    readIO
    processMessages
end

defun processMessage msg is
    define split string-split msg " "
    define command car split
     if map-exists? commands msg
          define f map-get commands msg
           f cdr split
     end
 end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants