This commit is contained in:
Pieter Vander Vennet 2024-12-26 17:21:14 +01:00
parent 4a74e5c8bb
commit 340f256074
2 changed files with 7 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "mastodon-bot",
"version": "0.0.4",
"version": "0.0.5",
"author": "Pietervdvn",
"license": "GPL",
"description": "Experimenting with mastodon-bot",

View file

@ -68,7 +68,12 @@ export default class OsmUserInfo {
return undefined
}
const url = new URL(mastodonLinks[0])
let mastodonlink = mastodonLinks[0]
while(mastodonlink.endsWith("/")){
mastodonlink = mastodonlink.substring(0, mastodonlink.length - 1)
}
const url = new URL(mastodonlink)
const username = url.pathname.split("/").at(-1) + (url.host === mastodonApi.hostname ? "" : "@" + url.host)
if (await mastodonApi.hasNoBot(username)) {