archive- Random tools & helpful resources for IRC |
git clone git://git.acid.vegas/archive.git |
Log | Files | Refs | Archive |
commit 6b6d199ccf886d2e327593a06241f4b08b7ff5d8
parent 142de532c38d3a2905af0f3978739e19cef244e3 Author: acidvegas <acid.vegas@acid.vegas> Date: Tue, 25 Jul 2023 15:12:26 -0400 acidvegas is a skid Diffstat:
|
1 file changed, 4 insertions(+), 3 deletions(-) |
diff --git a/bots/tailbot.py b/bots/tailbot.py @@ -64,11 +64,12 @@ class Bot(): if not os.path.exists(FIFO_PATH): os.mkfifo(FIFO_PATH) while True: - async with aiofiles.open(FIFO_PATH) as fifo: + async with aiofiles.open(FIFO_PATH, mode='r') as fifo: while True: try: - for line in fifo.readlines(): - await self.sendmsg(connection.channel, line.rstrip()) + content = await fifo.readlines() + for line in content: + await self.sendmsg(connection.channel, line) await asyncio.sleep(0.1) except Exception as ex: try: |