Support all mastodon links
This commit is contained in:
parent
41b2e75865
commit
b28d146d5a
1 changed files with 3 additions and 3 deletions
|
@ -31,12 +31,12 @@ class MisskeyPreviewModule(niobot.Module):
|
|||
continue
|
||||
elif len(sent) >= 5:
|
||||
break
|
||||
resp = await client.post("https://%s/api/notes/show" % parsed.netloc, json={"noteId": post_id})
|
||||
resp = await client.get("https://%s/api/v1/statuses/%s" % (parsed.netloc, post_id))
|
||||
if resp.status_code != 200:
|
||||
continue
|
||||
data = resp.json()
|
||||
username = data["user"]["username"]
|
||||
if not data["text"]:
|
||||
username = data["user"]["fqn"]
|
||||
if not data.get("text"):
|
||||
continue
|
||||
|
||||
text = textwrap.shorten(data["text"], width=1000)
|
||||
|
|
Loading…
Reference in a new issue