Skip to content

Instantly share code, notes, and snippets.

@qnub
Last active February 21, 2026 12:33
Show Gist options
  • Select an option

  • Save qnub/2c844496ce61e02367375b0cde7e160f to your computer and use it in GitHub Desktop.

Select an option

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
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