discord-mudlet-map
Version:
This little library helps with Discord bot configuration to provide small Mudlet map fragment images with given location.
15 lines (14 loc) • 360 B
JavaScript
let plainRegexp = (regexp, searchFunction) => (message, reader) => {
if (!searchFunction) {
searchFunction = (arg) => arg[1]
}
let matches = message.match(regexp)
if (matches) {
return searchFunction(matches, reader);
} else {
return false;
}
};
module.exports = {
plainRegexp: plainRegexp,
};