MCPcopy Index your code
hub / github.com/cnodejs/nodeclub / fetchUsers

Function fetchUsers

services/at.js:21–33  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

19 * @return {Array} 用户名数组
20 */
21var fetchUsers = function (text) {
22 var results = text.match(/@[a-zA-Z0-9]+/ig);
23 var names = [];
24 if (results) {
25 for (var i = 0, l = results.length; i < l; i++) {
26 var s = results[i];
27 //remove char @
28 s = s.slice(1);
29 names.push(s);
30 }
31 }
32 return names;
33};
34
35/**
36 * 根据文本内容中读取用户,并发送消息给提到的用户

Callers 2

at.jsFile · 0.85
at.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected