Created
June 26, 2015 14:17
-
-
Save sbp/dd972c14ce7081840a91 to your computer and use it in GitHub Desktop.
saxo logging plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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