UNPKG

t-comm

Version:

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

20 lines (18 loc) 425 B
/** * 获取 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; } export { getMentionRtx };