UNPKG

kbotify

Version:

kaiheila bot framework

44 lines 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseUser = void 0; const bot_object_1 = require("../base/bot.object"); /** * * * @export * @class BaseUser * @extends {BaseObject} * @implements {User} */ class BaseUser extends bot_object_1.BaseObject { constructor(userObject, client) { super(client); this.id = ''; this.username = ''; this.grantRole = async (roleId, guildId) => { return this.client.API.guildRole.grant(guildId, this.id, roleId); }; this.revokeRole = async (roleId, guildId) => { return this.client.API.guildRole.revoke(guildId, this.id, roleId); }; this.id = userObject.id; this.username = userObject.username; this.identifyNum = userObject.identifyNum; this.online = userObject.online; this.avatar = userObject.avatar; if ('nickname' in userObject) { this.nickname = userObject.nickname; } this.bot = userObject.bot; } get mention() { if (this.client.mentionWithSpace) { return `(met)${this.id}(met) `; } else { return `(met)${this.id}(met)`; } } } exports.BaseUser = BaseUser; //# sourceMappingURL=user.base.js.map