mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
createdAt
This commit is contained in:
@@ -27,6 +27,11 @@ isPrivate
|
||||
|
||||
Indicates whether the channel is PM channel, is `Boolean`.
|
||||
|
||||
createdAt
|
||||
~~~~~~~~~
|
||||
|
||||
A `Date` referring to when the channel was created.
|
||||
|
||||
--------
|
||||
|
||||
Functions
|
||||
|
||||
@@ -50,6 +50,11 @@ client
|
||||
|
||||
The Client_ that cached the role.
|
||||
|
||||
createdAt
|
||||
~~~~~~~~~
|
||||
|
||||
A `Date` referring to when the role was created.
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
|
||||
@@ -79,6 +79,11 @@ iconURL
|
||||
|
||||
The URL of the Server's icon. If the server doesn't have an icon, this will be null.
|
||||
|
||||
createdAt
|
||||
~~~~~~~~~
|
||||
|
||||
A `Date` referring to when the server was created.
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
|
||||
@@ -82,6 +82,11 @@ voiceChannel
|
||||
|
||||
The VoiceChannel_ the user is connected to. If they aren't in any voice channels, this will be ``null``.
|
||||
|
||||
createdAt
|
||||
~~~~~~~~~
|
||||
|
||||
A `Date` referring to when the user was created.
|
||||
|
||||
Functions
|
||||
---------
|
||||
|
||||
|
||||
@@ -32,6 +32,11 @@ var Channel = (function (_Equality) {
|
||||
};
|
||||
|
||||
_createClass(Channel, [{
|
||||
key: "createdAt",
|
||||
get: function get() {
|
||||
return new Date(+this.id / 4194304 + 1420070400000);
|
||||
}
|
||||
}, {
|
||||
key: "isPrivate",
|
||||
get: function get() {
|
||||
return !this.server;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var _Constants = require("../Constants");
|
||||
@@ -175,6 +177,13 @@ var Role = (function () {
|
||||
return this.mention();
|
||||
};
|
||||
|
||||
_createClass(Role, [{
|
||||
key: "createdAt",
|
||||
get: function get() {
|
||||
return new Date(+this.id / 4194304 + 1420070400000);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Role;
|
||||
})();
|
||||
|
||||
|
||||
@@ -375,6 +375,11 @@ var Server = (function (_Equality) {
|
||||
};
|
||||
|
||||
_createClass(Server, [{
|
||||
key: "createdAt",
|
||||
get: function get() {
|
||||
return new Date(+this.id / 4194304 + 1420070400000);
|
||||
}
|
||||
}, {
|
||||
key: "iconURL",
|
||||
get: function get() {
|
||||
if (!this.icon) {
|
||||
|
||||
@@ -102,6 +102,11 @@ var User = (function (_Equality) {
|
||||
};
|
||||
|
||||
_createClass(User, [{
|
||||
key: "createdAt",
|
||||
get: function get() {
|
||||
return new Date(+this.id / 4194304 + 1420070400000);
|
||||
}
|
||||
}, {
|
||||
key: "avatarURL",
|
||||
get: function get() {
|
||||
if (!this.avatar) {
|
||||
|
||||
@@ -4,13 +4,16 @@ import Equality from "../Util/Equality";
|
||||
import {reg} from "../Util/ArgumentRegulariser";
|
||||
|
||||
export default class Channel extends Equality {
|
||||
|
||||
constructor(data, client){
|
||||
super();
|
||||
this.id = data.id;
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
get createdAt() {
|
||||
return new Date((+this.id / 4194304) + 1420070400000);
|
||||
}
|
||||
|
||||
get isPrivate() {
|
||||
return !this.server;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,10 @@ export default class Role {
|
||||
this.mentionable = data.mentionable || false;
|
||||
}
|
||||
|
||||
get createdAt() {
|
||||
return new Date((+this.id / 4194304) + 1420070400000);
|
||||
}
|
||||
|
||||
serialise(explicit){
|
||||
|
||||
var hp = (perm) => this.hasPermission(perm, explicit);
|
||||
|
||||
@@ -106,6 +106,10 @@ export default class Server extends Equality {
|
||||
}
|
||||
}
|
||||
|
||||
get createdAt() {
|
||||
return new Date((+this.id / 4194304) + 1420070400000);
|
||||
}
|
||||
|
||||
detailsOf(user) {
|
||||
user = this.client.internal.resolver.resolveUser(user);
|
||||
if (user) {
|
||||
|
||||
@@ -23,6 +23,10 @@ export default class User extends Equality{
|
||||
this.voiceState = {};
|
||||
}
|
||||
|
||||
get createdAt() {
|
||||
return new Date((+this.id / 4194304) + 1420070400000);
|
||||
}
|
||||
|
||||
get avatarURL(){
|
||||
if(!this.avatar){
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user