Skip to content

Instantly share code, notes, and snippets.

@KartikTalwar
Created April 24, 2012 18:44
Show Gist options
  • Save KartikTalwar/2482534 to your computer and use it in GitHub Desktop.
Save KartikTalwar/2482534 to your computer and use it in GitHub Desktop.
Ned Bot Plugin
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);
}
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"));
}
@BENEFITBOYS1
Copy link

Plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment