This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = new Promise((resolve, reject) => { | |
console.log('config module loaded!'); | |
const foo = {}; | |
getAsyncConfig(foo) | |
.then(config => { | |
resolve(config); | |
}); | |
}); | |
function getAsyncConfig(foo) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var re = /#(foo|bar|baz)/i; | |
var message = '@bot #bAz'; | |
var tagAttributes = message.match(re); | |
var tag = tagAttributes[1].toLowerCase(); | |
console.log(tag); |