From 6689131bc795d43f985efa2fba02fd717ab432ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Wed, 13 Sep 2017 23:17:30 +0300 Subject: [PATCH] Add bot_response() to API --- ircbot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ircbot.py b/ircbot.py index 0d9276d..2de60d7 100644 --- a/ircbot.py +++ b/ircbot.py @@ -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: