mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
feat(Activity): support for CUSTOM_STATUS activity type (#3353)
* feat: support for custom status in activity * nit(typings): order properties
This commit is contained in:
committed by
SpaceEEC
parent
1b1289b35e
commit
2ca74d6b63
@@ -3,6 +3,7 @@
|
||||
const Util = require('../util/Util');
|
||||
const ActivityFlags = require('../util/ActivityFlags');
|
||||
const { ActivityTypes } = require('../util/Constants');
|
||||
const Emoji = require('./Emoji');
|
||||
|
||||
/**
|
||||
* Activity sent in a message.
|
||||
@@ -205,6 +206,18 @@ class Activity {
|
||||
* @type {Readonly<ActivityFlags>}
|
||||
*/
|
||||
this.flags = new ActivityFlags(data.flags).freeze();
|
||||
|
||||
/**
|
||||
* Emoji for a custom activity
|
||||
* @type {?Emoji}
|
||||
*/
|
||||
this.emoji = data.emoji ? new Emoji(presence.client, data.emoji) : null;
|
||||
|
||||
/**
|
||||
* Creation date of the activity
|
||||
* @type {number}
|
||||
*/
|
||||
this.createdTimestamp = new Date(data.created_at).getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -221,6 +234,15 @@ class Activity {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* The time the activity was created at
|
||||
* @type {Date}
|
||||
* @readonly
|
||||
*/
|
||||
get createdAt() {
|
||||
return new Date(this.createdTimestamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* When concatenated with a string, this automatically returns the activities' name instead of the Activity object.
|
||||
* @returns {string}
|
||||
|
||||
Reference in New Issue
Block a user