From f641af96d843d9fd25b07a906b01247e96c26e32 Mon Sep 17 00:00:00 2001 From: Mint <> Date: Tue, 7 Mar 2023 16:43:05 +0300 Subject: [PATCH] Few more fixes --- reply.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reply.py b/reply.py index 440f486..7de3726 100755 --- a/reply.py +++ b/reply.py @@ -80,7 +80,7 @@ class ReplyBot: try: status = await self.pleroma.get_status(argument) if status['content'] != "": - keywords = cleanup_toot(utils.extract_post_content(status['content']), self.cfg) + keywords = self.cleanup_toot(utils.extract_post_content(status['content']), self.cfg) else: keywords = None @@ -88,8 +88,9 @@ class ReplyBot: toot = self.cleanup_toot(toot, self.cfg) await self.pleroma.reply(status, toot, cw=self.cfg['cw']) except: - tg.start_soon(self.pleroma.react, post_id, '❌') - tg.start_soon(self.pleroma.reply, notification['status'], 'Error: ' + exc.args[0]) + async with anyio.create_task_group() as tg: + tg.start_soon(self.pleroma.react, post_id, '❌') + tg.start_soon(self.pleroma.reply, notification['status'], 'Error: ' + exc.args[0]) except pleroma.BadRequest as exc: async with anyio.create_task_group() as tg: tg.start_soon(self.pleroma.react, post_id, '❌')