First tilde projects commit

This commit is contained in:
RussellChamp committed 2015-01-02 16:59:08 +00:00
1 parent 9bcadfc4a7
commit 726861fae6
40 files changed
+20890

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import time
import re
def format_message(message):
pattern = r'^:.*\!~(.*)@.* (.*) (.*) :(.*)'
now = int(time.time())
matches = re.match(pattern, message)
if not matches:
return ''
nick = matches.group(1).strip()
command = matches.group(2).strip()
channel = matches.group(3).strip()
message = matches.group(4).strip()
return "%s\t%s\t%s\t%s\t%s" % (now, nick, command, channel, message)