зеркало из https://github.com/mozilla/gecko-dev.git
-- NOT PART OF ANY BUILD --
implement userIsOwner in ircbot.js move the hook initialization into a function in mingus.js
This commit is contained in:
Родитель
3a27d3d199
Коммит
2fd6277646
|
@ -28,6 +28,7 @@
|
|||
var LIB_PATH = "../lib/";
|
||||
|
||||
bot = new Object();
|
||||
bot.ownerPatterns = new Array();
|
||||
bot.personality = new Object();
|
||||
bot.personality.hooks = new Array();
|
||||
bot.prefix = "!js ";
|
||||
|
@ -152,10 +153,39 @@ function rego()
|
|||
|
||||
}
|
||||
|
||||
function addOwner (pattern)
|
||||
{
|
||||
bot.ownerPatterns.push (pattern);
|
||||
}
|
||||
|
||||
function userIsOwner (user)
|
||||
{
|
||||
/*XXX implement this*/
|
||||
return true;
|
||||
if (!user.host)
|
||||
{
|
||||
/* we havn't got any information on this user yet. They havn't spoken
|
||||
* yet, and we havn't /whoi's them yet. Say no for now, but do the
|
||||
* /whois so we'll know for sure next time.
|
||||
*/
|
||||
if (user.TYPE == "IRCChanUser")
|
||||
user.parent.parent.sendData ("WHOIS " + user.nick + "\n");
|
||||
else
|
||||
user.parent.sendData ("WHOIS " + user.nick + "\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
var userString = user.nick + "!" + user.name + "@" + user.host;
|
||||
dd ("userIsOwner: checking userString `" + userString + "' against:");
|
||||
|
||||
for (var p in bot.ownerPatterns)
|
||||
if (userString.search(bot.ownerPatterns[p]) != -1)
|
||||
{
|
||||
dd (String(bot.ownerPatterns[p]) + " passed.");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
dd (String(bot.ownerPatterns[p]) + " fails.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function psn_isAddressedToMe (e)
|
||||
|
@ -250,36 +280,38 @@ function my_chan_privmsg (e)
|
|||
{
|
||||
var user = e.user;
|
||||
var meat = e.meat;
|
||||
if (meat.indexOf(bot.prefix) == 0)
|
||||
{
|
||||
/* if last char is a continuation character, then... */
|
||||
if (meat[meat.length - 1] == '\\') {
|
||||
user.accumulatedScript = meat.substring(bot.prefix.length,
|
||||
meat.length - 1);
|
||||
return false; // prevent other hooks from processing this...
|
||||
}
|
||||
if (userIsOwner(user))
|
||||
if (meat.indexOf(bot.prefix) == 0)
|
||||
{
|
||||
/* if last char is a continuation character, then... */
|
||||
if (meat[meat.length - 1] == '\\') {
|
||||
user.accumulatedScript = meat.substring(bot.prefix.length,
|
||||
meat.length - 1);
|
||||
return false; // prevent other hooks from processing this...
|
||||
}
|
||||
else
|
||||
{
|
||||
return bot_eval(e, meat.substring(bot.prefix.length,
|
||||
meat.length));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return bot_eval(e, meat.substring(bot.prefix.length, meat.length));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* if we were accumulating a message, add here,
|
||||
* and finish if not ends with '\'. */
|
||||
if (typeof(user.accumulatedScript) != "undefined")
|
||||
{
|
||||
var lastLine = (meat[meat.length - 1] != '\\');
|
||||
var line = meat.substring(0, meat.length - (lastLine ? 0 : 1));
|
||||
user.accumulatedScript += line;
|
||||
if (lastLine)
|
||||
/* if we were accumulating a message, add here,
|
||||
* and finish if not ends with '\'. */
|
||||
if (typeof(user.accumulatedScript) != "undefined")
|
||||
{
|
||||
var script = user.accumulatedScript;
|
||||
delete user.accumulatedScript;
|
||||
return bot_eval(e, script);
|
||||
var lastLine = (meat[meat.length - 1] != '\\');
|
||||
var line = meat.substring(0, meat.length - (lastLine ? 0 : 1));
|
||||
user.accumulatedScript += line;
|
||||
if (lastLine)
|
||||
{
|
||||
var script = user.accumulatedScript;
|
||||
delete user.accumulatedScript;
|
||||
return bot_eval(e, script);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -31,11 +31,16 @@ bot.personality.guessActionPrefixes = ["guesses ", "postulates ", "figures ",
|
|||
function initMingus ()
|
||||
{
|
||||
|
||||
addOwner (/rginda.*!.*@adsl-63-198-63-20.dsl.snfc21.pacbell.net/i);
|
||||
addOwner (/rginda.*!.*@.*netscape.com/i);
|
||||
|
||||
bot.primNet = bot.networks["moznet"];
|
||||
|
||||
load ("DP.js");
|
||||
CIRCNetwork.prototype.INITIAL_NICK = "mingus";
|
||||
CIRCNetwork.prototype.INITIAL_NAME = "mingus";
|
||||
CIRCNetwork.prototype.INITIAL_DESC = "real men do it with prototypes";
|
||||
CIRCNetwork.prototype.INITIAL_CHANNEL = "#jsbot";
|
||||
CIRCNetwork.prototype.INITIAL_CHANNEL = "#chatzilla";
|
||||
bot.eventPump.addHook (psn_isAddressedToMe, psn_onAddressedMsg,
|
||||
"addressed-to-me-hook");
|
||||
bot.personality.dp = new CDPressMachine();
|
||||
|
@ -44,324 +49,323 @@ function initMingus ()
|
|||
CIRCNetwork.prototype.INITIAL_NICK +
|
||||
", hear me roar.");
|
||||
*/
|
||||
bot.personality.dp.addPhrase ("rumors of my death have been greatly " +
|
||||
"exaggerated");
|
||||
}
|
||||
bot.personality.dp.addPhrase ("\01ACTION is back.");
|
||||
|
||||
/* dp hooks start */
|
||||
/* dp hooks start */
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var catchall = (e.hooks[e.hooks.length - 1].name == "catchall");
|
||||
var answer = "";
|
||||
|
||||
if (catchall)
|
||||
var f = function (e)
|
||||
{
|
||||
var ary = e.statement.split(" ");
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
answer =
|
||||
bot.personality.dp.getPhraseContaining(getRandomElement(ary));
|
||||
if (answer)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!answer)
|
||||
answer = bot.personality.dp.getPhrase();
|
||||
|
||||
if (answer[answer.length - 1] == "\01")
|
||||
{
|
||||
if (answer[0] != "\01")
|
||||
if (catchall)
|
||||
answer = "\01ACTION " +
|
||||
getRandomElement(bot.personality.guessActionPrefixes) +
|
||||
answer;
|
||||
else
|
||||
answer = "\01ACTION " + answer;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!answer)
|
||||
answer = "I don't know anything";
|
||||
var catchall = (e.hooks[e.hooks.length - 1].name == "catchall");
|
||||
var answer = "";
|
||||
|
||||
if (catchall)
|
||||
{
|
||||
var ary = e.statement.split(" ");
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
answer =
|
||||
bot.personality.dp.getPhraseContaining(getRandomElement(ary));
|
||||
if (answer)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!answer)
|
||||
answer = bot.personality.dp.getPhrase();
|
||||
|
||||
if (answer[answer.length - 1] == "\01")
|
||||
{
|
||||
if (answer[0] != "\01")
|
||||
if (catchall)
|
||||
answer = "\01ACTION " +
|
||||
getRandomElement(bot.personality.guessActionPrefes) +
|
||||
answer;
|
||||
else
|
||||
answer = "\01ACTION " + answer;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!answer)
|
||||
answer = "I don't know anything";
|
||||
if (catchall)
|
||||
answer = getRandomElement(bot.personality.guessPrefixes) +
|
||||
answer;
|
||||
}
|
||||
answer;
|
||||
}
|
||||
|
||||
if (answer[0] != "\01")
|
||||
if (answer[0] != "\01")
|
||||
e.replyTo.say (e.user.properNick + ", " + answer);
|
||||
else
|
||||
else
|
||||
e.replyTo.say (answer);
|
||||
|
||||
return false;
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* first hook added is last checked */
|
||||
bot.personality.addHook (/.*/i, f, "catchall");
|
||||
bot.personality.addHook (/speak$/i, f, "speak");
|
||||
bot.personality.addHook (/talk$/i, f, "hook");
|
||||
bot.personality.addHook (/say something$/i, f, "say-something");
|
||||
bot.personality.addHook (/.*/i, f, "catchall");
|
||||
bot.personality.addHook (/speak$/i, f, "speak");
|
||||
bot.personality.addHook (/talk$/i, f, "hook");
|
||||
bot.personality.addHook (/say something$/i, f, "say-something");
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var subject = e.matchresult[1].match(CDPressMachine.WORD_PATTERN);
|
||||
if (subject == null)
|
||||
subject = "";
|
||||
else
|
||||
subject = subject.toString();
|
||||
|
||||
var answer =
|
||||
bot.personality.dp.getPhraseContaining (escape(subject.toLowerCase()));
|
||||
|
||||
if (!answer)
|
||||
answer = "I dont know anything about " + e.matchresult[1];
|
||||
|
||||
if (answer.charCodeAt (0) != 1)
|
||||
e.replyTo.say (e.user.properNick + ", " + answer);
|
||||
else
|
||||
e.replyTo.say (answer);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/speak about (\S+)/i, f);
|
||||
bot.personality.addHook (/talk about (\S+)/i, f);
|
||||
bot.personality.addHook (/say something about (\S+)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var answer = bot.personality.dp.getPhraseContaining ("%01ACTION");
|
||||
|
||||
if (!answer)
|
||||
answer = "I can't do a thing.";
|
||||
|
||||
e.replyTo.say (answer);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/do something/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var ary = bot.personality.dp.getPhraseWeights (e.matchresult[1]);
|
||||
var c = bot.personality.dp.getPhraseWeight (e.matchresult[1]);
|
||||
|
||||
e.replyTo.say (e.user.properNick + ", that phrase weighs " + c + ": " + ary);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/weigh (.+)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var word = e.matchresult[1].toLowerCase();
|
||||
var pivot = bot.personality.dp.getPivot(word);
|
||||
var result = "";
|
||||
|
||||
if (pivot)
|
||||
f = function (e)
|
||||
{
|
||||
var list, w, l;
|
||||
|
||||
list = pivot.previousList;
|
||||
|
||||
w = list.getListWeights();
|
||||
l = list.getListLinks();
|
||||
|
||||
if (w.length != l.length)
|
||||
e.replyTo.say ("warning: previous list mismatched.");
|
||||
|
||||
for (var i = 0; i < (Math.max(w.length, l.length)); i++)
|
||||
result += ( "`" + l[i] + "'" + w[i] + " " );
|
||||
|
||||
if (result.length > 250)
|
||||
result += "\n";
|
||||
|
||||
result += ( "[" + word + "]" );
|
||||
|
||||
if (result.length > 250)
|
||||
result += "\n";
|
||||
|
||||
list = pivot.nextList;
|
||||
|
||||
w = list.getListWeights();
|
||||
l = list.getListLinks();
|
||||
|
||||
if (w.length != l.length)
|
||||
e.replyTo.say ("warning: next list mismatched.");
|
||||
|
||||
for (var i = 0; i < (Math.max(w.length, l.length)); i++)
|
||||
result += ( " `" + l[i] + "'" + w[i] );
|
||||
|
||||
}
|
||||
else
|
||||
result = "- [" + word + "] -";
|
||||
|
||||
e.replyTo.say (result);
|
||||
|
||||
return false;
|
||||
var subject = e.matchresult[1].match(CDPressMachine.WORD_PATTERN);
|
||||
if (subject == null)
|
||||
subject = "";
|
||||
else
|
||||
subject = subject.toString();
|
||||
|
||||
}
|
||||
var answer =
|
||||
bot.personality.dp.getPhraseContaining (escape(subject.toLowerCase()));
|
||||
|
||||
bot.personality.addHook(/pivot (.*)/i, f);
|
||||
if (!answer)
|
||||
answer = "I dont know anything about " + e.matchresult[1];
|
||||
|
||||
if (answer.charCodeAt (0) != 1)
|
||||
e.replyTo.say (e.user.properNick + ", " + answer);
|
||||
else
|
||||
e.replyTo.say (answer);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/speak about (\S+)/i, f);
|
||||
bot.personality.addHook (/talk about (\S+)/i, f);
|
||||
bot.personality.addHook (/say something about (\S+)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var answer = bot.personality.dp.getPhraseContaining ("%01ACTION");
|
||||
|
||||
if (!answer)
|
||||
answer = "I can't do a thing.";
|
||||
|
||||
e.replyTo.say (answer);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/do something/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var ary = bot.personality.dp.getPhraseWeights (e.matchresult[1]);
|
||||
var c = bot.personality.dp.getPhraseWeight (e.matchresult[1]);
|
||||
|
||||
e.replyTo.say (e.user.properNick + ", that phrase weighs " + c + ": " + ary);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/weigh (.+)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
var word = e.matchresult[1].toLowerCase();
|
||||
var pivot = bot.personality.dp.getPivot(word);
|
||||
var result = "";
|
||||
|
||||
if (pivot)
|
||||
{
|
||||
var list, w, l;
|
||||
|
||||
list = pivot.previousList;
|
||||
|
||||
w = list.getListWeights();
|
||||
l = list.getListLinks();
|
||||
|
||||
if (w.length != l.length)
|
||||
e.replyTo.say ("warning: previous list mismatched.");
|
||||
|
||||
for (var i = 0; i < (Math.max(w.length, l.length)); i++)
|
||||
result += ( "`" + l[i] + "'" + w[i] + " " );
|
||||
|
||||
if (result.length > 250)
|
||||
result += "\n";
|
||||
|
||||
result += ( "[" + word + "]" );
|
||||
|
||||
if (result.length > 250)
|
||||
result += "\n";
|
||||
|
||||
list = pivot.nextList;
|
||||
|
||||
w = list.getListWeights();
|
||||
l = list.getListLinks();
|
||||
|
||||
if (w.length != l.length)
|
||||
e.replyTo.say ("warning: next list mismatched.");
|
||||
|
||||
for (var i = 0; i < (Math.max(w.length, l.length)); i++)
|
||||
result += ( " `" + l[i] + "'" + w[i] );
|
||||
|
||||
}
|
||||
else
|
||||
result = "- [" + word + "] -";
|
||||
|
||||
e.replyTo.say (result);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook(/pivot (.*)/i, f);
|
||||
|
||||
/* dp hooks end */
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
print ("I can hear you.");
|
||||
e.replyTo.say (e.user.properNick + ", yes, I am.");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/are you alive(\?)?/i, f);
|
||||
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (!userIsOwner(e.user))
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say ("nope.");
|
||||
return;
|
||||
print ("I can hear you.");
|
||||
e.replyTo.say (e.user.properNick + ", yes, I am.");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
chan = e.matchresult[1];
|
||||
bot.personality.addHook (/are you alive(\?)?/i, f);
|
||||
|
||||
if (chan.charAt (0) != "#")
|
||||
chan = "#" + chan;
|
||||
|
||||
e.server.sendData ("join " + chan + "\n");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/join\s+(\S+)\.*/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (!userIsOwner (e.user))
|
||||
f = function (e)
|
||||
{
|
||||
e.channel.say ("nope.");
|
||||
if (!userIsOwner(e.user))
|
||||
{
|
||||
e.replyTo.say ("nope.");
|
||||
return;
|
||||
}
|
||||
|
||||
chan = e.matchresult[1];
|
||||
|
||||
if (chan.charAt (0) != "#")
|
||||
chan = "#" + chan;
|
||||
|
||||
e.server.sendData ("join " + chan + "\n");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/join\s+(\S+)\.*/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (!userIsOwner (e.user))
|
||||
{
|
||||
e.channel.say ("nope.");
|
||||
return false;
|
||||
}
|
||||
|
||||
chan = e.matchresult[1];
|
||||
|
||||
if (chan.charAt (0) != "#")
|
||||
chan = "#" + chan;
|
||||
|
||||
e.server.sendData ("part " + chan + "\n");
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/part\s+(\S+)\.*/i, f);
|
||||
bot.personality.addHook (/leave\s+(\S+)\.*/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say ("mmmmmmm. Thanks " + e.user.properNick + ".");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/botsnack/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.act ("blushes");
|
||||
return false;
|
||||
}
|
||||
|
||||
chan = e.matchresult[1];
|
||||
bot.personality.addHook (/you rock/i, f);
|
||||
|
||||
if (chan.charAt (0) != "#")
|
||||
chan = "#" + chan;
|
||||
f = function (e)
|
||||
{
|
||||
if (e.matchresult[1] == "me")
|
||||
e.replyTo.act ("hugs " + e.user.properNick);
|
||||
else
|
||||
e.replyTo.act ("hugs " + e.matchresult[1]);
|
||||
return false;
|
||||
}
|
||||
|
||||
e.server.sendData ("part " + chan + "\n");
|
||||
bot.personality.addHook (/hug (.*)/i, f);
|
||||
|
||||
return false;
|
||||
f = function (e)
|
||||
{
|
||||
if (e.matchresult[1] == "me")
|
||||
e.replyTo.say (e.user.properNick + ", :*");
|
||||
else
|
||||
e.replyTo.say (e.matchresult[1] + ", :*");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/kiss (\w+)/, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (e.user.properNick + ", I'll try :(");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook
|
||||
(/(shut up)|(shaddup)|(be quiet)|(keep quiet)|(sssh)|(stfu)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (!userIsOwner (e.user))
|
||||
e.replyTo.say ("No.");
|
||||
else
|
||||
{
|
||||
for (var n in bot.networks)
|
||||
bot.networks[n].quit("Goodnight.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(go to bed)|(go to sleep)|(sleep)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":)");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook
|
||||
(/(smile)|(rotfl)|(lmao)|(rotflmao)|(look happy)|(you(.)?re smart)/i, f);
|
||||
/* (/(smile)|(rotfl)|(lmao)|(rotflmao)|(you(.)?re funny)|(look happy)|(you(.)?re smart)/i, f); */
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":(");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(frown)|(don(.)?t like you)|(look sad)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (">:|");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(look mad)|(beat you up)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":/");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(look confused)|(i like windows)/i, f);
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/part\s+(\S+)\.*/i, f);
|
||||
bot.personality.addHook (/leave\s+(\S+)\.*/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say ("mmmmmmm. Thanks " + e.user.properNick + ".");
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bot.personality.addHook (/botsnack/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.act ("blushes");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/you rock/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (e.matchresult[1] == "me")
|
||||
e.replyTo.act ("hugs " + e.user.properNick);
|
||||
else
|
||||
e.replyTo.act ("hugs " + e.matchresult[1]);
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/hug (.*)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (e.matchresult[1] == "me")
|
||||
e.replyTo.say (e.user.properNick + ", :*");
|
||||
else
|
||||
e.replyTo.say (e.matchresult[1] + ", :*");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/kiss (\w+)/, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (e.user.properNick + ", I'll try :(");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook
|
||||
(/(shut up)|(shaddup)|(be quiet)|(keep quiet)|(sssh)|(stfu)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
if (!userIsOwner (e.user))
|
||||
e.replyTo.say ("No.");
|
||||
else
|
||||
{
|
||||
for (var n in bot.networks)
|
||||
bot.networks[n].quit("Goodnight.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(go to bed)|(go to sleep)|(sleep)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":)");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook
|
||||
(/(smile)|(rotfl)|(lmao)|(rotflmao)|(look happy)|(you(.)?re smart)/i, f);
|
||||
/* (/(smile)|(rotfl)|(lmao)|(rotflmao)|(you(.)?re funny)|(look happy)|(you(.)?re smart)/i, f); */
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":(");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(frown)|(don(.)?t like you)|(look sad)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (">:|");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(look mad)|(beat you up)/i, f);
|
||||
|
||||
f = function (e)
|
||||
{
|
||||
e.replyTo.say (":/");
|
||||
return false;
|
||||
}
|
||||
|
||||
bot.personality.addHook (/(look confused)|(i like windows)/i, f);
|
||||
|
||||
delete f;
|
||||
|
|
Загрузка…
Ссылка в новой задаче