@lskjs/bots-plugin-portal
Version:
LSK.js plugin for @lskjs/bots module for telegram, slack, discord, whatsapp, twitter, instagram and vk bots creation
24 lines (23 loc) • 627 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = _default;
function _default(_ref) {
var _this = this;
var text = _ref.text;
if (!text) text = '@{{username}}';
var _this$ctx$from = this.ctx.from,
username = _this$ctx$from.username,
id = _this$ctx$from.id;
var title = text.replace(/{{\w*}}/g, function (key) {
return _this.ctx.from[key.slice(2, -2)];
});
var value = username ? "https://t.me/".concat(username) : "tg://user?id=".concat(id);
return [{
type: 'url',
title: title,
value: value
}];
}
//# sourceMappingURL=keyboard.js.map