Skip to content

feat: Provide users an alternative link to view x threads#514

Merged
vcarl merged 4 commits intoreactiflux:mainfrom
asbedb:feat-x-alt
Feb 26, 2026
Merged

feat: Provide users an alternative link to view x threads#514
vcarl merged 4 commits intoreactiflux:mainfrom
asbedb:feat-x-alt

Conversation

@asbedb
Copy link
Contributor

@asbedb asbedb commented Feb 26, 2026

Description

Introduces a new xCancelGenerator handler that automatically detects Twitter/X links and provides an alternative xcancel.com link. This ensures that community members can view linked content and threads without being forced to log in to an X account.

Summary Features

  • Uses Regex to detect only status links from x and twitter -> /https?:\/\/(?:www\.)?(?:x|twitter)\.com\/\w+\/status\/\d+/i.
  • Suppresses embed of original link if a match has been detected.
  • Returns a converted link using xcancel.com which allows users to read threads without an account.

Tests

Conducted Tests on RTS prior to finalising PR:
image

@what-the-diff
Copy link

what-the-diff bot commented Feb 26, 2026

PR Summary

  • New Feature Development
    A new feature was added to process messages containing Twitter links and convert them into a more user-friendly URL format. This enhancement was realized through a new file named x-cancel-generator.ts.

  • Pattern Matching Enhancement
    We introduced a pattern matching technique, here represented as TWITTER_REGEX. Its basic function is to identify Twitter status URLs present in the data effectively.

  • Improved Message Processing
    The processing ability of our system has been enhanced by logically ignoring messages from automated sources or bots. Additionally, unnecessary information, known as 'embeds', are now suppressed, contributing to a cleaner user interface. An adequately converted URL is sent to xcancel.com, ensuring the data redirection process is smooth.

  • Integration Effort
    Finally, with the update of index.ts, the newly created feature xCancelGenerator is successfully registered within the main list of handlers, consolidating this improvement with existing functionalities. This ensures the new feature works seamlessly with the existing structure.

const [url] = match;
const alternativeUrl = url.replace(/(x|twitter)\.com/i, "xcancel.com");
await msg.channel.send(
`This \`x.com\` link has been converted to \`xcancel.com\` so that server members won't require an account to view content and threads:\n ${alternativeUrl}`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about trimming it down further? 👀

Suggested change
`This \`x.com\` link has been converted to \`xcancel.com\` so that server members won't require an account to view content and threads:\n ${alternativeUrl}`,
`[Converted to \`xcancel.com\` for members with no X account](${alternativeUrl})`,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Done

@vcarl vcarl merged commit ca53165 into reactiflux:main Feb 26, 2026
2 checks passed
@asbedb asbedb deleted the feat-x-alt branch February 26, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants