Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 botkit 我设置message_received或任何其他处理程序。当我收到消息时,它的text属性应该包含用户编写的实际消息。不幸的是,当此消息包含例如电子邮件地址时,我会收到此消息的松弛格式。例子:
message_received
text
用户输入:Hey, send an email to foo@bar.com
Hey, send an email to foo@bar.com
botkit给了我:Hey, send an email to <mailto:foo@bar.com|foo@bar.com>
Hey, send an email to <mailto:foo@bar.com|foo@bar.com>
有没有办法以原始形式获取它,或者我应该手动解包?
做类似的事情:
var matches = response.text.match(/\|.*>/) log.info("Matches : " + matches) if (matches) { mail = matches[0].substring(1, matches[0].length - 1) log.info("Mail : " + mail) }