Add bot_response() to API

This commit is contained in:
Juhani Krekelä 2017-09-13 23:17:30 +03:00
parent 845fb1bab2
commit 6689131bc7
1 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,10 @@ class API:
line = b'PRIVMSG ' + recipient + b' :' + message
self.serverthread_object.send_line_raw(line)
def bot_response(self, recipient, message):
"""Prefix message with ZWSP and convert from unicode to bytestring."""
self.msg(recipient, ('\u200b' + message).encode('utf-8'))
def nick(self, nick):
"""Send a NICK command and update the internal nick tracking state"""
with self.serverthread_object.nick_lock: