UNPKG

kbotify

Version:

kaiheila bot framework

36 lines 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PrivateChannel = void 0; const bot_object_1 = require("../base/bot.object"); class PrivateChannel extends bot_object_1.BaseObject { constructor(rawChannelObject, client) { super(client); this.invite = undefined; this.full = async () => { const rawChannel = await this.client.API.channel.view(this.id); return new PrivateChannel(rawChannel, this.client); }; this.sendMessage = async (type, content, quote) => { return this.client.API.directMessage.create(type, this.id, undefined, content, quote); }; this.client = client; this.id = rawChannelObject.id; const raw = rawChannelObject; for (const prop in rawChannelObject) { this[prop] = raw[prop] !== undefined ? raw[prop] : this[prop]; } } get mention() { if (this.client.mentionWithSpace) { return `(chn)${this.id}(chn) `; } else { return `(chn)${this.id}(chn)`; } } } exports.PrivateChannel = PrivateChannel; PrivateChannel.fromRaw = (rawChannelObject, client) => { return new PrivateChannel(rawChannelObject, client); }; //# sourceMappingURL=private.js.map