小编Aak*_*Kag的帖子

如何将会话数据存储到Bot Builder中的自定义存储中

我正在使用Node js构建聊天机器人。

我目前正在将会话数据存储到Microsoft默认存储中,每个用户会话的限制为64K。我想使用自己的存储设备来存储会话数据。是我从Microsoft开发人员那里获得的帮助。

我能够存储在文档数据库和Azure表中。

不过,我还是很困惑。我们将如何实现IStorageClient存储在自己的数据库中的接口?

无论何时设置,session.UserData.name=""它都应存储在自己的数据库中。

node.js botframework

5
推荐指数
1
解决办法
2449
查看次数

找到所有单词以特定字符开头,后跟字符串中的数字

我想找到所有以mc开头并且后跟所有数字的单词

var myString="hi mc1001 hello mc1002 mc1003 mc1004 mc mca" 
Run Code Online (Sandbox Code Playgroud)

需要输出= [mc1001,mc1002,mc1003,mc1004]

我的解决方案

var myRegEx = /(?:^|\s)mc(.*?)(?:\s|$)/g;

function getMatches(string, regex, index) {
    index || (index = 1); // default to the first capturing group
    var matches = [];
    var match;
    console.log("string==",string)
    while (match = regex.exec(string)) {
        console.log("string==",string)
        matches.push(match[index]);
    }
    return matches;
}

var matches = getMatches(myString, myRegEx, 1);
console.log("matches===>",matches)
Run Code Online (Sandbox Code Playgroud)

面临的问题:我的代码只返回所有奇怪的possting单词我只使用节点js

javascript regex jquery node.js

2
推荐指数
1
解决办法
656
查看次数

标签 统计

node.js ×2

botframework ×1

javascript ×1

jquery ×1

regex ×1