This commit is contained in:
Nexus 2024-08-11 15:32:38 +01:00
parent b2b0235a02
commit 01598f3b1e

View file

@ -38,13 +38,12 @@ class MisskeyPreviewModule(niobot.Module):
self.log.info("Already sent 5 posts, stopping")
break
resp = await client.get("https://%s/api/v1/statuses/%s" % (parsed.netloc, post_id))
self.log.critical(resp)
if resp.status_code != 200:
self.log.error("Got HTTP %d from %s", resp.status_code, resp.url)
continue
data = resp.json()
self.log.info("Got data: %r", data)
username = data["user"]["fqn"]
username = data["account"]["fqn"]
if not data.get("text"):
self.log.warning("No text for post %s", post_id)
continue