Last active
December 16, 2015 01:49
-
-
Save glucero/5358218 to your computer and use it in GitHub Desktop.
Example Smith Plugin
This file contains hidden or 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
# Description | |
# Example Plugin | |
# | |
# Commands | |
# smith example | |
# smith repeat <words> | |
# smith roll die | |
module.exports = (robot) -> | |
robot.respond /example$/i, (msg) -> | |
msg.send "This is an example!" | |
robot.respond /repeat\s(.+)$/i, (msg) -> | |
msg.send "You said '#{msg.match[1]}'!" | |
robot.respond /roll die/i, (msg) -> | |
msg.send "You rolled a #{(Math.floor(Math.random() * 6) + 1}!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment