diff --git a/squeebot.repo.json b/squeebot.repo.json index 0c9b17f..1bccf55 100644 --- a/squeebot.repo.json +++ b/squeebot.repo.json @@ -31,7 +31,7 @@ }, { "name": "url-fediverse", - "version": "1.0.1" + "version": "1.0.2" }, { "name": "url-peertube", diff --git a/url-fediverse/plugin.json b/url-fediverse/plugin.json index 1e9634d..ad9cfb4 100644 --- a/url-fediverse/plugin.json +++ b/url-fediverse/plugin.json @@ -2,7 +2,7 @@ "main": "plugin.js", "name": "url-fediverse", "description": "URLReply Fediverse", - "version": "1.0.1", + "version": "1.0.2", "tags": ["urlreply"], "dependencies": ["urlreply"], "npmDependencies": [] diff --git a/url-fediverse/plugin.ts b/url-fediverse/plugin.ts index d911299..38c3d60 100644 --- a/url-fediverse/plugin.ts +++ b/url-fediverse/plugin.ts @@ -56,6 +56,11 @@ async function mastodonResponse(msg: IMessage, url: string, type = 'Mastodon'): keys.push(['bold', '@' + data.account.acct + ':']); keys.push(['field', end, { type: 'content' }]); + if (data.media_attachments?.length) { + const amount = data.media_attachments.length; + keys.push(['field', `[${amount} attachment${amount !== 1 ? 's' : ''}]`, { color: 'brown' }]); + } + msg.resolve(keys); return true; }