migme-seagull
Version:
Migme Chat
60 lines (49 loc) • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getEmoticon = undefined;
exports.default = Emoticons;
var _dinghy = require('./utils/dinghy');
var _dinghy2 = _interopRequireDefault(_dinghy);
var _migmeFerry = require('migme-ferry');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _getEmoticon(dinghy, hotkey_list) {
var packet = new _migmeFerry.Packet(_migmeFerry.PacketType.GET_EMOTICON, {
hotkey_list: hotkey_list,
use_json_data: true
});
return dinghy.send(packet, _migmeFerry.PacketType.GET_EMOTICONS_COMPLETE);
}
/**
* Emoticons
*/
exports.getEmoticon = _getEmoticon;
function Emoticons() {
var dinghy = (0, _dinghy2.default)();
return {
/**
* Gets emoticons
* @return {Promise}
* @example
* emoticons.list()
*/
list: function list() {
var packet = new _migmeFerry.Packet(_migmeFerry.PacketType.GET_EMOTICON_HOTKEYS);
return dinghy.send(packet);
},
/**
* Gets emoticons
* @param {Array} hotkey_list - Array of emoticons to get
* @return {Promise}
* @example
* emoticons.getEmoticon(['(somesticker)'])
*/
getEmoticon: function getEmoticon(hotkey_list) {
return _getEmoticon(dinghy, hotkey_list);
},
get dinghy() {
return dinghy;
}
};
}