Skip to content

Instantly share code, notes, and snippets.

@sbp
Created June 26, 2015 14:17
Show Gist options
  • Save sbp/dd972c14ce7081840a91 to your computer and use it in GitHub Desktop.
Save sbp/dd972c14ce7081840a91 to your computer and use it in GitHub Desktop.
saxo logging plugin
import os.path
import time
import saxo
log = None
@saxo.setup
def open_log(irc):
global log
try: log = open(os.path.expanduser("~/.CHANNEL"), "a", encoding="utf-8")
except: ...
@saxo.event("PRIVMSG")
def record(irc):
if irc.sender != "#CHANNEL":
return
if irc.nick not in {"NICKNAME_ONE", "NICKNAME_TWO"}:
return
if irc.text.startswith("\x01ACTION"):
return
print(int(time.time()), irc.text, file=log)
log.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment