Skip to content

Add options to remove the fixed links - #124

Open
seirenkr wants to merge 3 commits into
Kyrela:mainfrom
seirenkr:feat/fixed-links-removal
Open

seirenkr wants to merge 3 commits into
Kyrela:mainfrom
seirenkr:feat/fixed-links-removal

Conversation

@seirenkr

@seirenkr seirenkr commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Built on top of #122 (Components V2), whose commits also show up here until it is merged. The change itself is the last commit: seirenkr/FixTweetBot@feat/components-v2...feat/fixed-links-removal

Closes #13.

Summary

A new "Fixed links removal" screen in /settings, with three options that are all off by default:

  • Delete the fixed link when the original message is deleted. As planned in Have an option to delete the bot's message if the user deleted their message with a supported link #13, it is not available while the original message is deleted once fixed: the option is then disabled in the screen and reset in the database.
  • Let a ❌ reaction delete the fixed link, for the author of the original message and the members who can manage messages.
  • Add that ❌ reaction to the fixed links, so that it only has to be clicked. It depends on the previous option (disabled and reset without it) and needs Add Reactions and Read Message History: the troubleshooting screen lists them, the menu shows a ⚠️ when they are missing, and the reaction is then not attempted.

How it works

  • The bot remembers which fixed messages answer which message in memory only, capped at 20 000 entries (about 10 000 fixes). Nothing is stored: after a restart, the links fixed before it can no longer be removed this way.
  • Everything goes through raw events (on_raw_message_delete, on_raw_bulk_message_delete, on_raw_reaction_add), so it doesn't depend on the message cache.
  • The original message can be deleted while its links are being fixed (slow fixer, moderation bot): the fixed link is then not sent, or deleted right away, and not reported as a failed embed.
  • When the bot deletes the original message itself, the fixed link stays.
  • The reactions need the GUILD_MESSAGE_REACTIONS intent, which is not privileged. The bot then receives the reactions of every server; each one costs a dictionary lookup.

Database and README

  • Three boolean columns on guilds, false by default: delete_with_original, delete_on_reaction and add_delete_reaction (after reply_as_original_author_replica). The migration was generated with masonite-orm migration.
  • README: one feature line, and "Possibility for op to delete the bot's post" becomes ✓ in the comparison table.

Test plan

  • Scenarios run by script against the real fix_embeds() and listeners: original deleted before, during and after the fix; bulk deletion; reaction from the author, a moderator, another member, a bot and the bot itself; each option off; original deleted by the bot; missing permissions; the cap.
  • Migration applied, rolled back and applied again on MariaDB 12.
  • Every screen, button and modal of the settings exercised on this branch, with the same scripts as Rebuild the settings with Components V2 #122.
  • On a test server: a fixed link deleted along with its original message, deleted with ❌ by its author, and the ❌ added by the bot.

Written with Claude Code (Claude Fable 5.2, credited as co-author of the commits).

🤖 Generated with Claude Code

seirenkr and others added 3 commits November 12, 2026 08:15
Every screen of `/settings` is now a container made of texts, sections and action rows instead of an embed followed
by buttons: a toggle sits next to the state it changes, and the texts are no longer limited by the embed fields.
The modals wrap their inputs in labels, as the label of a text input itself is deprecated.

The screens keep their content and their behaviour. The differences:
- the websites are still listed in a single select, but its pages are changed from inside the list ("Previous page"
  and "Next page" options) instead of a button below it;
- the custom websites select describes each website with its fixed domain, and is hidden when there is none;
- the filter and reply method screens start with their description, like the other screens;
- the texts are built with the locale of the interaction: discore only sets it when a command is invoked, so a
  screen refreshed by a button could come back in the language of the last command, whoever invoked it;
- editing a keyword without changing it no longer answers that it already exists;
- the texts typed in the modals are stripped: a blank keyword is ignored, a custom website without a name is listed
  by its domain, and a translation language has to be two letters.

The strings that are no longer used are removed from the source locale (and from the Korean one).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`/remove_premium` also stops after reporting a failure, instead of answering the interaction a second time.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three options, off by default, in a new "Fixed links removal" screen:
- delete the fixed links when their original message is deleted (not available while the original message is
  deleted once fixed, as nothing is left to delete them along with);
- let the author of the original message, and the members who can manage messages, delete a fixed link by reacting
  to it with ❌;
- have the bot add that ❌ reaction itself, so that it only has to be clicked.

The fixed messages are remembered in memory only (capped), which is enough to know which message answers which:
nothing is stored, and the links fixed before a restart are simply not removable this way anymore.
The reactions need the `GUILD_MESSAGE_REACTIONS` intent, which is not privileged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@seirenkr
seirenkr marked this pull request as ready for review November 12, 2026 04:47
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.

Have an option to delete the bot's message if the user deleted their message with a supported link

1 participant