Skip to content

Instantly share code, notes, and snippets.

@pajlada
Last active August 29, 2015 14:22
Show Gist options
  • Save pajlada/a91de83e24d8db4f018d to your computer and use it in GitHub Desktop.
Save pajlada/a91de83e24d8db4f018d to your computer and use it in GitHub Desktop.
assist = function(message, advice) {
var params = _.rest(message.split(' '), 1);
if (params.length >= 1) {
get_user_by_param(params, function(err, user, db_user) {
if (user) {
chatMessage('/me @' + user.username + ' ' + advice );
} else {
chatMessage('/me ' + advice);
}
});
} else {
chatMessage('/me ' + advice);
}
exports.names = ['tp', 'tastyplug'];
exports.hidden = false;
exports.enabled = true;
exports.matchStart = true;
exports.cd_all = 15;
exports.cd_user = 30;
exports.cd_manager = 10;
exports.handler = function (data) {
assist(data.message, 'https://fungustime.pw/tastyplug/');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment