summaryrefslogtreecommitdiff |
path: root/jh-discord.py
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-04-01 22:08:39 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-04-01 22:08:39 +0200 |
commit | fd3d958533a5d438b97e5d1d703ef6afab9fb46a (patch) | |
tree | 12bfe37731a0d930ef050bad8c3bd5c3480b698b /jh-discord.py | |
parent | 10b516b1b82479d6547c25edca36ad3629bbcd2c (diff) |
...
Diffstat (limited to 'jh-discord.py')
-rw-r--r-- | jh-discord.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/jh-discord.py b/jh-discord.py index 543269b..57116bf 100644 --- a/jh-discord.py +++ b/jh-discord.py @@ -97,7 +97,8 @@ async def on_message(message): has_lock = False try: - msg = bytes(message.clean_content.replace('\n', ' '), "utf8", 'ignore') + msg_encoded = message.clean_content.encode('utf-8') + msg = msg_encoded.replace(b'\n', b' ') server_mutex.acquire() has_lock = True @@ -115,11 +116,11 @@ async def on_message(message): + " <" + str(message.author.name) + "> " - + str(message.clean_content) + + str(msg_encoded) ) if (len(result) > 0): - print("#" + str(message.channel.name) + " <- " + result) + print("#" + str(message.channel.name) + " <- " + str(result.encode('utf-8'))) if (len(result) > 0): await client.send_message(message.channel, result) |