mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
Modified some bots. Added madlib bot.
This commit is contained in:
1 parent
e9fc646207
commit
1671c4f3cb
19 files changed
+482
-25
No files matched your search
@@ -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)
|
||||
Reference in new issue
Block a user