Last active
February 21, 2026 12:33
-
-
Save qnub/2c844496ce61e02367375b0cde7e160f to your computer and use it in GitHub Desktop.
IFTTT filter to compose message from telegram for othersocials with cleared @channel tags
This file contains hidden or 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
| const urlConcat = '…\n\n🔗 '; | |
| function removeAtTailFromHashtags(str: String) { | |
| return str.replace(/#[\w-_\.]+@[\w-_\.]+/g, (match) => { | |
| // Find the position of @ and return everything before it | |
| return match.substring(0, match.indexOf('@')); | |
| }); | |
| } | |
| // replace `newChannelPhoto` with `newChannelText` fro non image post | |
| const postUrl = Telegram.newChannelPhoto.PostUrl; | |
| // replace `newChannelPhoto` with `newChannelText` fro non image post | |
| // replace `Caption` with `PostText` fro non image post | |
| const text = removeAtTailFromHashtags(Telegram.newChannelPhoto.Caption); | |
| const text300 = text.trim().slice(0, 299 - postUrl.length - urlConcat.length) | |
| // replace `createImagePost` with `createTextPost` fro non image post | |
| Bluesky.createImagePost.setText(text300 + urlConcat + postUrl); | |
| // replace `createPhotoPage` with `createStatusMessagePage` fro non image post | |
| FacebookPages.createStatusMessagePage.setMessage(text + urlConcat + postUrl); | |
| // replace `postNewTweetWithImage` with `postNewTweet` fro non image post | |
| Twitter.postNewTweet.setTweet(text + urlConcat + postUrl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment