UNPKG

@ginstone/nga-api

Version:

28 lines (27 loc) 784 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EmoteGroup = exports.Emote = void 0; class Emote { constructor(groupKey, key, value) { this.key = key; this.bbsCode = `[s:${groupKey}:${key}]`; this.filename = value; this.url = "https://img4.nga.178.com/ngabbs/post/smile/" + value; } } exports.Emote = Emote; const NAME_KEY = "_______name"; class EmoteGroup { constructor(key, value) { this.key = key; this.name = value[NAME_KEY]; this.emotes = []; Object.keys(value).forEach(k => { const v = value[k]; if (k !== NAME_KEY) { this.emotes.push(new Emote(key, k, v)); } }); } } exports.EmoteGroup = EmoteGroup;