forked from suchipi/link-fixer-discord-bot
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: link replacements for bluesky (#147)
* utilizes VixBluesky * supports normal URLS + did:pic urls (see AT URI scheme) * closes #142
- Loading branch information
1 parent
02f4ec4
commit 6012f14
Showing
4 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import BaseReplacement from "./BaseReplacement"; | ||
|
||
export default class BskyReplacement extends BaseReplacement { | ||
constructor(newDomain: string) { | ||
super( | ||
newDomain, | ||
// plc is 24 chars | ||
// https://github.com/did-method-plc/did-method-plc?tab=readme-ov-file#identifier-syntax | ||
// TID length is always 13 ASCII characters | ||
// https://atproto.com/specs/record-key#record-key-type-tid | ||
/https?:\/\/bsky\.app\/profile\/((\w|\.|-)+|(did:plc:[234567a-z]{24}))\/post\/[234567a-z]{13}(?!\/)/g, | ||
/bsky\.app\//, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters