Skip to content

Instantly share code, notes, and snippets.

@silentrob
Last active August 29, 2015 14:07
Show Gist options
  • Save silentrob/31898a3ed6fb923497ca to your computer and use it in GitHub Desktop.
Save silentrob/31898a3ed6fb923497ca to your computer and use it in GitHub Desktop.
SuperScript Plugin Example
+ custom function
- ^runCode()
// When the input "custom function" is seen, we call the function runCode() from the plugin folder.
exports.runCode = function(cb) {
cb(err, reply);
}
// Data can also be passed into the function like this:
+ custom function *1
- ^runCode(<cap1>)
exports.runCode = function(capturedText, cb) {
cb(err, capturedText.length);
}
// Finally, we also have the full Message Object, and User Object available to the function.
exports.runCode = function(cb) {
cb(err, (this.message.sentiment < 0) ? "Hey, be nice" : "That's sweet");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment