mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user