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

feat(InteractionResponse): createdTimestamp #8917

Merged
merged 4 commits into from
Dec 14, 2022
Merged

feat(InteractionResponse): createdTimestamp #8917

merged 4 commits into from
Dec 14, 2022

Conversation

BenjammingKirby
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
InteractionResponses have IDs, we can just destructure it and get createdAt and createdTimestamp, (it's a getter because other such properties on other classes were getters)
Close #8916
Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

@vercel
Copy link

vercel bot commented Dec 9, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Dec 14, 2022 at 9:33PM (UTC)
discord-js-guide ⬜️ Ignored (Inspect) Dec 14, 2022 at 9:33PM (UTC)

Co-authored-by: MrMythicalYT <91077061+MrMythicalYT@users.noreply.github.com>
@MaksiRose
Copy link
Contributor

As far as I know, createdTimestamp is normally a normal property rather than a method. Is there a reason this is different here?

@imranbarbhuiya
Copy link
Contributor

This isn't a method but a getter that behaves like a property but u can return result dynamically

@BenjammingKirby
Copy link
Contributor Author

This isn't a method but a getter that behaves like a property but u can return result dynamically

I have no idea why though, as I mentioned, this is a getter because the other .createdTimestamp/createdAt I've seen have been getters, I don't think there's any need for it to be? since the ID is constant

@imranbarbhuiya
Copy link
Contributor

using property will store the Date and number in memory and using getter, it'll generate when needed without storing. Ig this is the reason for not using property but not sure tho

@Qjuh
Copy link
Contributor

Qjuh commented Dec 9, 2022

using property will store the Date and number in memory and using getter, it'll generate when needed without storing. Ig this is the reason for not using property but not sure tho

That, but also that it doesn’t have to be calculated at all if it isn’t used.

@kodiakhq kodiakhq bot merged commit 627511d into discordjs:main Dec 14, 2022
@BenjammingKirby BenjammingKirby deleted the feat/intrcTimestamp branch December 15, 2022 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add createdTimestamp property to InteractionResponse
9 participants