createdAt

This commit is contained in:
abalabahaha
2016-05-31 18:52:41 -07:00
parent d913d04f44
commit bd15cc68ce
12 changed files with 60 additions and 1 deletions

View File

@@ -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

View File

@@ -50,6 +50,11 @@ client
The Client_ that cached the role.
createdAt
~~~~~~~~~
A `Date` referring to when the role was created.
Functions
---------

View File

@@ -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
---------

View File

@@ -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
---------

View File

@@ -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;

View File

@@ -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;
})();

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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;