mirror of
https://git.kiwifarms.net/mint/ebooks.git
synced 2024-10-22 21:39:05 +00:00
Few more fixes
This commit is contained in:
parent
e11f386caa
commit
f641af96d8
1 changed files with 4 additions and 3 deletions
7
reply.py
7
reply.py
|
@ -80,7 +80,7 @@ class ReplyBot:
|
||||||
try:
|
try:
|
||||||
status = await self.pleroma.get_status(argument)
|
status = await self.pleroma.get_status(argument)
|
||||||
if status['content'] != "":
|
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:
|
else:
|
||||||
keywords = None
|
keywords = None
|
||||||
|
|
||||||
|
@ -88,8 +88,9 @@ class ReplyBot:
|
||||||
toot = self.cleanup_toot(toot, self.cfg)
|
toot = self.cleanup_toot(toot, self.cfg)
|
||||||
await self.pleroma.reply(status, toot, cw=self.cfg['cw'])
|
await self.pleroma.reply(status, toot, cw=self.cfg['cw'])
|
||||||
except:
|
except:
|
||||||
tg.start_soon(self.pleroma.react, post_id, '❌')
|
async with anyio.create_task_group() as tg:
|
||||||
tg.start_soon(self.pleroma.reply, notification['status'], 'Error: ' + exc.args[0])
|
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:
|
except pleroma.BadRequest as exc:
|
||||||
async with anyio.create_task_group() as tg:
|
async with anyio.create_task_group() as tg:
|
||||||
tg.start_soon(self.pleroma.react, post_id, '❌')
|
tg.start_soon(self.pleroma.react, post_id, '❌')
|
||||||
|
|
Loading…
Reference in a new issue