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

Structures Deleted Property #2489

Closed
UnseenFaith opened this issue Apr 21, 2018 · 0 comments
Closed

Structures Deleted Property #2489

UnseenFaith opened this issue Apr 21, 2018 · 0 comments

Comments

@UnseenFaith
Copy link
Contributor

UnseenFaith commented Apr 21, 2018

Please describe the problem you are having in as much detail as possible:

Currently the only way to check if a certain structure in Discord.js is stale is by checking the cache or crosschecking with the API.

Ex:
A Message is created and then deleted for whatever reason. The message object is removed from the API and the cache, but the object won't be GCed immediately. Now you have a stale message object and the only way to check if this message object is stale or not is by checking the cache
and/or trying to fetch the message back from the API.

This applies for pretty much any structure that can be deleted from the API.

It'd be nice to have a property on the structure that would be set to true, i.e. <Message>.deleted, when the Delete WS Event comes in for that structure.

<Structure>.deletable only checks whether or not the Bot has the Permissions to delete it, not if its already been deleted or not.

Edit: This is doesn't take in the fact that we have Events for those deletion purposes. I think the property could still be warranted as useful disregarding those.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants