Update: irc_nar.py: update IRC script to also work for matrix bridge. TODO update to Python3
@@ -31,7 +31,7 @@ import sys
import time
import itertools
-server = "irc.freenode.net"
+server = "irc.libera.chat"
channel = "#nars"
botnick = "nars42"
Narsese_Filter=["^","Answer:"]
@@ -67,15 +67,14 @@ while True:
if "VERSION" in text or "End of message of the day" in text:
irc.send("JOIN "+ channel +"\r\n") #join when version private message comes :D
else:
- SPL=text.split(":")
- TEXT=":".join(SPL[2:len(SPL)])
+ TEXT=text.replace(":|:","__REPLACE_EVENT_MARKER__").split(":")[-1].replace("__REPLACE_EVENT_MARKER__", ":|:")
if TEXT.replace(" ","").replace("\n","").replace("\r","")=="":
continue
if TEXT.startswith("*reset"):
proc.stdin.write("*reset\n")
- if TEXT.startswith("yan: ") or TEXT.startswith("(") or TEXT.startswith("<") or TEXT.startswith("100") or " :|:" in TEXT:
- if TEXT.startswith("yan: "):
- TEXT = TEXT.split("yan: ")[1]
+ if TEXT.startswith("nars: ") or TEXT.startswith("(") or TEXT.startswith("<") or TEXT.startswith("100") or " :|:" in TEXT:
+ if TEXT.startswith("nars: "):
+ TEXT = TEXT.split("nars: ")[1]
print "NAR input: "+TEXT
try:
proc.stdin.write(TEXT+"\n")
