From fe678249728e26dde89de2615fb37acfb79af641 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 27 Dec 2024 07:57:04 +0100 Subject: [PATCH] Mastodon: log returned toot dict, return id and uri --- voctopublish/api_client/mastodon_client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/voctopublish/api_client/mastodon_client.py b/voctopublish/api_client/mastodon_client.py index 96a6448..eb4ab59 100644 --- a/voctopublish/api_client/mastodon_client.py +++ b/voctopublish/api_client/mastodon_client.py @@ -64,7 +64,12 @@ def send_toot(ticket, config): access_token="mastodon_usercred.secret", api_base_url=config["mastodon"]["api_base_url"], ) - mastodon.toot(message) + toot = mastodon.toot(message) + LOG.debug(toot) + return { + 'id': toot['id'], + 'uri': toot['uri'], + } except Exception as e_: # we don't care if tooting fails here. LOG.exception("Tooting failed")