import aiofiles
import asyncio
+import base64
import errno
import logging
import posix
if self._stop:
break
if self._joined_room_id != None:
+ try:
+ msgB64Bytes = line.rstrip("\n").encode("UTF-8")
+ msgBytes = base64.b64decode(msgB64Bytes)
+ except:
+ self._log(logging.WARNING, "Error decoding message")
+ continue
await client.room_send(
room_id=self._joined_room_id,
message_type="m.room.message",
content={
"msgtype": "m.text",
- "body": line.rstrip("\n")
+ "body": msgBytes.decode("UTF-8")
}
)
else: