UNPKG

ggejs

Version:

A powerful Node.js module for interacting with the server of Goodgame Empire & Goodgame Empire: Four Kingdoms

34 lines (29 loc) 893 B
const BasicMessage = require("./BasicMessage"); const {readMessages} = require("../../commands/rms"); const EmpireError = require("../../tools/EmpireError"); class AllianceNewsMessage extends BasicMessage { /** @type {BaseClient} */ #client = null; _body = ""; /** * @param {BaseClient} client * @param {Array} data */ constructor(client, data) { super(client, data); this.#client = client; } async getBody() { try { if (this._body !== "") return this._body; this._body = await readMessages(this.#client, this.messageId); return this._body; } catch (e) { throw new EmpireError(this.#client, e); } } parseMetaData(client, metaArray) { this.subject = metaArray[0]; } } module.exports = AllianceNewsMessage;