fix(default-timestamp): add fallback to current date (#4081)

Uses a fallback value if nothing is passed because the timestamp property is marked as optional. This prevents errors when using the function without arguments.
This commit is contained in:
Dominik Koch
2025-01-01 09:26:09 -08:00
committed by GitHub
parent c569805249
commit a0fec368fa
+1 -1
View File
@@ -240,7 +240,7 @@ export class EmbedsBuilder extends Array<DiscordEmbed> {
* @returns {EmbedsBuilder}
*/
setTimestamp(timestamp?: string | number | Date): this {
this.#currentEmbed.timestamp = new Date(timestamp!).toISOString()
this.#currentEmbed.timestamp = new Date(timestamp ?? Date.now()).toISOString()
return this
}