Created
April 24, 2012 18:44
-
-
Save KartikTalwar/2482534 to your computer and use it in GitHub Desktop.
Ned Bot Plugin
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 plugin = { | |
name : 'greet', | |
trigger : ['hi', 'hello', 'wattup', 'whats up'], // built in prefix : ned | |
enabled : 'true', | |
general : 'true', | |
description : 'greets you', | |
usage : 'ned hi' | |
}; | |
module.exports.plugin = plugin; | |
module.exports[plugin.name] = function(params) | |
{ | |
// Available : | |
// params.message, params.from, params.roomName, params.originalMessage, params.isPrivate | |
var response = "Hello, " + params.from + "from " + params.roomName; | |
sendMessage(response); | |
} |
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 plugin = { | |
name : 'rules', | |
trigger : "(what are )?the (three |3 )?(rules|laws)$", // works without ned as a prefix | |
enabled : 'true', | |
general : 'true', | |
description : 'tells you the rules', | |
usage : 'what are the rules' | |
}; | |
module.exports.plugin = plugin; | |
module.exports[plugin.name] = function(params) | |
{ | |
// Available : | |
// params.message, params.from, params.roomName, params.originalMessage, params.isPrivate | |
var rules = [ | |
"1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.", | |
"2. A robot must obey any orders given to it by human beings, except where such orders would conflict with the First Law.", | |
"3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Law." | |
]; | |
sendMessage(rules.join("\n")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Plugin