Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- matcher = new RegExp "^#{args}"
- potentials = []
- for k, v of map
- potentials.push k if k.match matcher
- if potentials.length is 1
- redibot.sendMessage channel, map[potentials[0]]
- else
- redibot.sendMessage channel, "You could have meant: #{potentials.join ', '}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement