attachment count

This commit is contained in:
Evert Prants 2021-06-15 22:54:17 +03:00
parent 1ee60d9dd3
commit 8cce75646a
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
3 changed files with 7 additions and 2 deletions

View File

@ -31,7 +31,7 @@
},
{
"name": "url-fediverse",
"version": "1.0.1"
"version": "1.0.2"
},
{
"name": "url-peertube",

View File

@ -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": []

View File

@ -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;
}