From 6a2a7503cb5b7ebc1368c79dd0d6e7a869becd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Wed, 3 Jan 2018 21:32:00 +0200 Subject: [PATCH] Add bot_response_bytes --- ircbot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ircbot.py b/ircbot.py index bfbeae2..3adbb5d 100644 --- a/ircbot.py +++ b/ircbot.py @@ -78,6 +78,10 @@ class API: """Prefix message with ZWSP and convert from unicode to bytestring.""" self.msg(recipient, ('\u200b' + message).encode('utf-8')) + def bot_response_bytes(self, recipient, message): + """Prefix message (bytestring) with ZWSP""" + self.msg(recipient, '\u200b'.encode('utf-8') + message) + def nick(self, nick): """Send a NICK command and update the internal nick tracking state""" with self.serverthread_object.nick_lock: