Skip to content

Conversation

@ayubun
Copy link
Owner

@ayubun ayubun commented Aug 6, 2024

v1.2.0 will include a cache which will store message ids in order to save on requests to the discord api ૮ ˶ᵔ ᵕ ᵔ˶ ა

this will also allow for user-specific ttls, which are implemented here too~

note: the messages database will only contain ids; no message content will ever be stored by discord ttl

@7f8ddd
Copy link

7f8ddd commented Aug 6, 2024

Can Discord retrieve messages using their ID, even after they've been deleted?
Also, your versions are outdated, I would use bun update --latest.

@ayubun
Copy link
Owner Author

ayubun commented Aug 6, 2024

your versions are outdated, I would use bun update --latest.

hallo @7f8ddd, thx for the tip (≧ᗜ≦)ᡣ𐭩

Can Discord retrieve messages using their ID, even after they've been deleted?

you're best asking discord privacy for that .. i can't give any official answers (´• ω •`);

this is a hobby project that is not endorsed by discord. it is being made for my own use (and for fun) because i value message ttls, which discord doesn't support natively atm ૮ ◞ ⸝⸝ ◟ ྀིა

@ayubun ayubun force-pushed the dev branch 3 times, most recently from fe50e49 to 4ef7899 Compare August 6, 2024 06:47
@ayubun ayubun self-assigned this Aug 6, 2024
@ayubun ayubun changed the title v1.2.0 [v1.2.0] message ids cache Aug 6, 2024
@ayubun ayubun changed the title [v1.2.0] message ids cache [v1.1.2] message ids cache Aug 9, 2024
@ayubun ayubun force-pushed the dev branch 4 times, most recently from d479536 to b2547e6 Compare October 2, 2024 23:32
@ayubun ayubun changed the title [v1.1.2] message ids cache [v1.2.0] user ttls & message ids cache Oct 11, 2024
@ayubun
Copy link
Owner Author

ayubun commented Jan 26, 2025

dont worry guys one day ill finish this slowly but surely =w=


try {
const messageIdsMetadata = await getMessageIdsMetadata(serverId, channelId);
if (isAfterBotStartup(messageIdsMetadata.lastBackfilledMessageId)) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

i should move this up and add a more clear log

}

public static fromMessageData(data: MessageIdsData): Message {
return new Message(data.serverId, data.channelId, data.messageId, data.authorId);
Copy link
Owner Author

Choose a reason for hiding this comment

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

i should add the pin check here.
for ex:

  • cache pins somewhere in a set on startup & on pin update events(?) (is that a thing?)
  • upon creating a new msg object, check if the pin cache set has the message id
  • setPinned if so

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.

3 participants