Skip to content

feat(on_message): audit messages #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

theetrain
Copy link
Contributor

@theetrain theetrain commented Jul 17, 2025

Closes #55

  • Provide advice for certain message content
  • When messages contain links to x.com, send DM to user suggesting to use xcancel.com instead along with a copy-paste snippet to help.

Copy link
Member

@ghostdevv ghostdevv left a comment

Choose a reason for hiding this comment

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

Can you merge with main - I added some linting, updated deps, updated pocketbase (you might want to run go run main.go migrate history-sync in the pocketbase folder before running pnpm db:dev)

return newContent;
})();

await message.author.send(
Copy link
Member

Choose a reason for hiding this comment

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

we should catch this as if a user has their dms disabled this'll fail

Comment on lines 25 to 31
if (!caughtLinks) return;
const hasXLinks: boolean = caughtLinks.some((item) =>
item.startsWith('https://x.com'),
);
if (!hasXLinks) return;

Copy link
Member

Choose a reason for hiding this comment

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

small nit, can you add some spacing between blocks of logic so it's more readable

- Provide advise for certain message content
- When messages contain links to X, advise to use xcancel for better previews
- Attempt a DM first, if that fails then do an inline reply with the converted x.com link
@theetrain theetrain requested a review from ghostdevv July 18, 2025 01:25
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.

Handle links to X
2 participants