Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stalkwords = [];
- if(sys.getVal('stalkwords') !== "") {
- var nstalkwords = sys.getVal('stalkwords').split(",");
- stalkwords = nstalkwords.concat(stalkwords);
- stalkwords = eliminateDuplicates(stalkwords);
- };
- if(command == "stalkwords") {
- sys.stopEvent();
- sendBotMessage("Your stalkwords are: " + stalkwords);
- };
- if(command == "addstalkword") {
- sys.stopEvent();
- var nstalkwords = commandData;
- if(nstalkwords.search(/, /g) !== -1 || nstalkwords.search(/ ,/g) !== -1) {
- nstalkwords = nstalkwords.replace(/, /g, ",").replace(/ ,/g, ",");
- };
- nstalkwords = nstalkwords.split(",");
- stalkwords = eliminateDuplicates(nstalkwords.concat(stalkwords));
- sys.saveVal('stalkwords', stalkwords.toString());
- sendBotMessage("You added " + commandData + " to your stalkwords!");
- };
- if(command == "removestalkword") {
- sys.stopEvent();
- commandData = commandData.toLowerCase();
- for(var x in stalkwords) {
- if(stalkwords[x].toLowerCase() === commandData) {
- stalkwords.splice(x, 1);
- sys.saveVal('stalkwords', stalkwords.toString());
- sendBotMessage("You removed " + commandData + " from your stalkwords!");
- return;
- };
- };
- sendBotMessage("" + commandData + " is not a stalkword!");
- };
Add Comment
Please, Sign In to add comment