Fix: fix #5
This commit is contained in:
parent
4a74e5c8bb
commit
340f256074
2 changed files with 7 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "mastodon-bot",
|
"name": "mastodon-bot",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"author": "Pietervdvn",
|
"author": "Pietervdvn",
|
||||||
"license": "GPL",
|
"license": "GPL",
|
||||||
"description": "Experimenting with mastodon-bot",
|
"description": "Experimenting with mastodon-bot",
|
||||||
|
|
|
@ -68,7 +68,12 @@ export default class OsmUserInfo {
|
||||||
return undefined
|
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)
|
const username = url.pathname.split("/").at(-1) + (url.host === mastodonApi.hostname ? "" : "@" + url.host)
|
||||||
|
|
||||||
if (await mastodonApi.hasNoBot(username)) {
|
if (await mastodonApi.hasNoBot(username)) {
|
||||||
|
|
Loading…
Reference in a new issue