fix multiple mcabber cmds to fifo; 'unikot' cmd added

This commit is contained in:
urlbot
2014-08-10 22:19:48 +02:00
parent 0e7e53feb3
commit bc2af668cf

View File

@@ -88,7 +88,7 @@ def chat_write(message, prefix='/say '):
else: else:
try: try:
fd = open(fifo_path, 'wb') fd = open(fifo_path, 'wb')
msg = unicode(prefix) + unicode(message) msg = unicode(prefix) + unicode(message) + '\n'
fd.write(msg.encode('utf8')) fd.write(msg.encode('utf8'))
fd.close() fd.close()
except IOError: except IOError:
@@ -182,6 +182,11 @@ def parse_commands(data):
elif 'command' in data: elif 'command' in data:
if ratelimit_exceeded(): return False if ratelimit_exceeded(): return False
chat_write(reply_user + (""": known commands: 'command', 'info', 'hangup', 'ping', 'uptime'""")) chat_write(reply_user + (""": known commands: 'command', 'info', 'hangup', 'ping', 'uptime'"""))
elif 'unikot' in data:
if ratelimit_exceeded(): return False
chat_write(reply_user + (u''': ┌────────┐'''))
chat_write(reply_user + (u''': │Unicode!│'''))
chat_write(reply_user + (u''': └────────┘'''))
elif 'uptime' in data: elif 'uptime' in data:
if ratelimit_exceeded(): return False if ratelimit_exceeded(): return False