UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

24 lines (20 loc) 517 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); /** * 获取 rtx 拼接的提及字符串 * @param rawStr 原始字符串,比如 `foo,bar` * @returns 处理后的字符串,比如 <@foo><@bar> */ function getMentionRtx(rawStr) { if (rawStr === void 0) { rawStr = ''; } if (!rawStr) { return ''; } var result = rawStr.split(/,|;/).map(function (item) { return "<@".concat(item, ">"); }).join(''); return result; } exports.getMentionRtx = getMentionRtx;