Add iconURL/avatarURL and fix object.values reference

This commit is contained in:
Amish Shah
2016-08-26 19:00:50 +01:00
parent 0988b47fcd
commit e5057a5b6a
4 changed files with 26 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
const TextBasedChannel = require('./interface/TextBasedChannel');
const Constants = require('../util/Constants');
/**
* Represents a User on Discord.
@@ -65,6 +66,18 @@ class User {
return `<@${this.id}>`;
}
/**
* A link to the user's avatar (if they have one, otherwise null)
* @type {?String}
* @readonly
*/
get avatarURL() {
if (!this.avatar) {
return null;
}
return Constants.Endpoints.avatar(this.id, this.avatar);
}
/**
* Deletes a DM Channel (if one exists) between the Client and the User. Resolves with the Channel if successful.
* @return {Promise<DMChannel>}