Skip to content
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

Certain message types are not deletable #6551

Closed
dynamicbark opened this issue Nov 29, 2023 · 5 comments
Closed

Certain message types are not deletable #6551

dynamicbark opened this issue Nov 29, 2023 · 5 comments
Labels
bug synced Synced to internal tracker

Comments

@dynamicbark
Copy link

Description

Some message types are not deletable.

This includes:

  • Automod alerts
  • User was removed from thread

I haven't gone through and checked all of them, but these are the ones that I commonly run into.

Steps to Reproduce

Trigger an automod alert, try to delete the message it created.

Expected Behavior

You should be able to delete the automod alert message like any other message type. (Message pinned, user joined, etc.)

Current Behavior

The API disallows it.

Screenshots/Videos

No response

Client and System Information

n/a -- discord.js v14.14.1

@RedDaedalus
Copy link
Contributor

This is intended behavior, and documented in the "Deletable" field on the docs.

@Mati199330
Copy link

Ok

@jhgg
Copy link
Contributor

jhgg commented Dec 1, 2023

We should consider changing this behavior.

@DV8FromTheWorld DV8FromTheWorld added the synced Synced to internal tracker label Dec 4, 2023
@jhgg
Copy link
Contributor

jhgg commented Jan 17, 2024

The behavior has been changed and internally I've made it so that when a new message type is made, it is implicitly deletable (this used to have to be an explicit thing devs would set.)

Now, this has been inverted to a set of "undeletable" message types, which I'm reproducing below (with code comments and all so people understand the rationale.

    UNDELETABLE = {
        # These deal with GDM recipients being added/removed,
        # we should not allow these to be deleted, since they
        # deal joining/leaving a GDM, which should arguably have
        # an audit trail.
        _.RECIPIENT_ADD,
        _.RECIPIENT_REMOVE,
        # This deals with calls, and should not be deletable, as it
        # would potentially orphan the call (since the starter message,
        # is what triggers being able to join said call.)
        _.CALL,
        # These deal with changing a GDM name/icon, and arguably should have
        # an audit trail, and thus shouldn not be deletable.
        _.CHANNEL_NAME_CHANGE,
        _.CHANNEL_ICON_CHANGE,
        # This is the first message in a thread, and it's a pointer to a normal message.
        # As such, this message should not be deletable.
        _.THREAD_STARTER_MESSAGE,
    }

As such, this means that the following message types are now allowed to be deleted:

  • GUILD_DISCOVERY_DISQUALIFIED = 14
  • GUILD_DISCOVERY_REQUALIFIED = 15
  • GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING = 16
  • GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING = 17

Additionally, the following yet-to-be documented message types also are now able to be deleted:

  • GUILD_INCIDENT_ALERT_MODE_ENABLED = 36
  • GUILD_INCIDENT_ALERT_MODE_DISABLED = 37
  • GUILD_INCIDENT_REPORT_RAID = 38
  • GUILD_INCIDENT_REPORT_FALSE_ALARM = 39
  • PURCHASE_NOTIFICATION = 44

"User was removed from thread" notification unfortunately re-uses the RECIPIENT_REMOVE message type, and thus cannot be deleted at this time because it shouldn't be deletable in GDMs. Unfortunately, making a message type conditionally deletable based on channel type is a larger arc of work, so this isn't going to happen at this time.

@jhgg jhgg closed this as completed Jan 17, 2024
@dynamicbark
Copy link
Author

I would like to note that CHANNEL_NAME_CHANGE for GDMs is also reused with threads, thus it cannot be deleted. Hoping one day deleting based on channel type will become a thing like you said, but it's not going to happen at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug synced Synced to internal tracker
Projects
None yet
Development

No branches or pull requests

5 participants