mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
feat(RichEmbed): add timestamp support for setTimestamp (#3061)
This commit is contained in:
parent
1618829cc6
commit
49e8bd9edd
2 changed files with 4 additions and 3 deletions
|
|
@ -140,10 +140,11 @@ class RichEmbed {
|
|||
|
||||
/**
|
||||
* Sets the timestamp of this embed.
|
||||
* @param {Date} [timestamp=new Date()] The timestamp
|
||||
* @param {Date|number} [timestamp=Date.now()] The timestamp or date
|
||||
* @returns {RichEmbed} This embed
|
||||
*/
|
||||
setTimestamp(timestamp = new Date()) {
|
||||
setTimestamp(timestamp = Date.now()) {
|
||||
if (timestamp instanceof Date) timestamp = timestamp.getTime();
|
||||
this.timestamp = timestamp;
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
|
|
@ -1030,7 +1030,7 @@ declare module 'discord.js' {
|
|||
public setFooter(text: StringResolvable, icon?: string): this;
|
||||
public setImage(url: string): this;
|
||||
public setThumbnail(url: string): this;
|
||||
public setTimestamp(timestamp?: Date): this;
|
||||
public setTimestamp(timestamp?: Date | number): this;
|
||||
public setTitle(title: StringResolvable): this;
|
||||
public setURL(url: string): this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue