Added setAvatar

This commit is contained in:
hydrabolt
2015-11-19 16:52:01 +00:00
parent e486ad1a79
commit e08c10507d
7 changed files with 78 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
"use strict";
/* global Buffer */
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -21,6 +22,14 @@ var Resolver = (function () {
this.internal = internal;
}
Resolver.prototype.resolveToBase64 = function resolveToBase64(resource) {
if (resource instanceof Buffer) {
resource = resource.toString("base64");
resource = "data:image/jpg;base64," + resource;
}
return resource;
};
Resolver.prototype.resolveInviteID = function resolveInviteID(resource) {
if (resource instanceof Invite) {
return resource.id;