notify telegram of new comments

This commit is contained in:
j 2023-08-31 17:12:34 +01:00
commit 92f21cc859
2 changed files with 18 additions and 0 deletions

View file

@ -171,6 +171,11 @@ def publish_comment(request):
send_reaction(
account, comment.data["moderator_ts"], "🎉", group=group
)
link = request.build_absolute_uri(comment.item.get_absolute_url())
msg = '%s commented on <b>%s</b> at <a href="%s">%s</a>' % (
comment.name, comment.item.title, link, link
)
tasks.notify_telegram.delay(msg)
response['status'] = 'ok'
else:
response['error'] = 'permission denied'