eazar001 / yesbot

IRC Bot Written in Prolog
MIT License
19 stars 5 forks source link

send_msg(priv_msg)/2 and other applicable variants not designed to handle paragraphs #11

Closed eazar001 closed 9 years ago

eazar001 commented 9 years ago

Although this is possible by threading together multiple instances of this predicate, it's not as abstract as one would desire. I should design something to make this more convenient for the future.

eazar001 commented 9 years ago

Addition of priv_msg/2 to utilities.pl allows one to send private messages without having to go through send_msg/3. This also handles newlines. Just to keep it simple newlines within the context of this predicate means \n. In the interest of keeping the semantics clear and seperate from prolog IO predicates like format/3, etc. .... I will not be giving the ~n sequence any special treatment.

Example:

?- priv_msg("test message\nnewline", "##prolog")

Output:
yesbot | test message
yesbot | newline
Anniepoo commented 9 years ago

crlf is converted to \n when reading/writing text mode in prolog by definition. In effect prolog internally is 'always unix'