Skip to content
165 changes: 148 additions & 17 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,103 @@ function respond() {
botRegexAd=/^\/advance/;botRegexGTA = /^\/gta/; botRegexSC = /^\/SDL/i; botODB = /(.*\s+)(.*odb)(\s+.*)/i; botDuck = /^\/duck/;
botRegexP = /^\/PDL/i; botRegexTw = /^\/twitch/i; botRegexSb = /^\/sub/; botRegexSh = /^\/shrug/; botRegexWk = /^\/users/; botRegexCC = /^\/cc/;
botRegexSiege = /^\/siege/; botRegexOW = /^\/ratings/;
botRegexSlut = /^\/slut/; botRegexStop = /^\/stop/;
botRegexOh = /^\/oh/; botRegexRiot = /^\/riot/; botRegexStandings = /^\/standings/;
botRegexProp = /^\/prop/;botRegexKys = /^\/kys/; botRegexSlam = /^\/slam/; botRegexBrye = /^\/brye/;
botRegexGian = /^\/gian/; botRegexScrotes = /^\/scrotes/; botRegexShaki = /^\/shaki/;
botRegexDaf = /^\/dafuq/; botRegexMA32 = /^\/pending/; botRegexTrade = /^\/trade/;
botRegexGian = /^\/gian/; botRegexScrotes = /^\/scrotes/; botRegexShaki = /^\/shaki/; botRegexHype = /^\/hype/;
botRegexDaf = /^\/dafuq/; botRegexMA32 = /^\/pending/; botRegexTrade = /^\/trade/; botRegexShady = /^\/shady/;
botRegex4thDown = /^\/4thdown/; botRegexStatCap = /^\/statcap/; botRegexMix = /^\/mixer/i;
botRegexSchedule = /^\/schedule/;
botRegexMulti = /^\/mstream/i;
botRegexHelp = /^\/help/;
botSoftDoot = /^\/dootdootdoot/;
botDancingDoot = /^\/DootDoot/;
botCommList = /^\/commishinfo/;
botTCList = /^\/tcinfo/;
botRegexStatLeader = /^\/statboard/i;
botSportsBook = /^\/betline/;

botRegexBitch = /^\/bitch/; botRegexGame = /^\/game/; botRegexBG = /^\/bg/; botRegexClown = /^\/clowning/; botRegexNoVance = /^\/novance/;
siege1 = 'https://i.groupme.com/350x419.png.adc8c73a6c1547e0a9e04320296329f8'; siege2 = 'https://i.groupme.com/1279x752.jpeg.aa5d0401e0df495bba4b4e09dc5a6bd7'
siege3 = 'https://i.groupme.com/960x960.png.006e180e05d841c6a2962e844bf1e6fd';
var teamAb = ["NE","NO","ARI","PHI","CLE","TEN","OAK","DAL","IND","SEA","CIN","PIT","JAC"
,"BAL","SD","DEN","MIN","ATL","KC","NYG","GB","DET","HOU","STL","CHI","CAR",
"MIA","BUF","SF","WAS","NYJ","TB"]

if(request.text && botRegex.test(request.text)) {
this.res.writeHead(200);
postMessage(cool());
this.res.end();
}
else if(request.text && botRegexSlut.test(request.text)) {

else if(request.text && botSportsBook.test(request.text)) {
this.res.writeHead(200);
postMessage("https://docs.google.com/spreadsheets/d/1wzofmsbLnydmpdXlspA19IKE33l-OQBwzNaq_kduNVM/edit?ts=5e89e1ad#gid=0");
this.res.end();
}
else if(request.text && botRegexStatLeader.test(request.text)) {
this.res.writeHead(200);
postMessage("http://daddyleagues.com/snd/stats/"+request.text.substring(11,request.text.length));
this.res.end();
}

else if(request.text && botCommList.test(request.text)) {
this.res.writeHead(200);
postMessage("Commissioners. Contact for issues, questions:\n- Cowboys - Brad \n- 49ers - Michael\n- Bills - Joao\n- Ravens - Raza");
this.res.end();
}

else if(request.text && botTCList.test(request.text)) {
this.res.writeHead(200);
postMessage("Trade Committee Members:\n- Cowboys - Brad\n- Bills - Joao\n- 49ers - Michael\n- Ravens - Raza\n- Bengals - Kenny");
this.res.end();
}

else if(request.text && botDancingDoot.test(request.text)) {
this.res.writeHead(200);
postMessage("https://media.tenor.com/images/1970ddb19e0493351a4c0c13fa4cb401/tenor.gif");
this.res.end();
}

else if(request.text && botSoftDoot.test(request.text)) {
this.res.writeHead(200);
postMessage("https://media.giphy.com/media/Y2bmgFIyzz7r2/200.gif");
this.res.end();
}

else if(request.text && botRegexHelp.test(request.text)) {
this.res.writeHead(200);
postMessage("HELP MENU\n ----DL Commands----\n -To see current Commissioner Committee members: \n/commishinfo\n -To see current Trade Committee members: \n/tcinfo\n -To view team's schedule:\n/sdl [team abbreviation]\n -To view team's depth chart:\n/ddl [team abbreviation]\n -To view the league's weekly schedule:\n /schedule\n -To view the league's current standings:\n /standings\n -To view a player or players:\n /pdl [name]\n ----Trades/POS Changes/Suspensions----\n -To view trades, position changes, and suspensions:\n /trades\n ----Rules----\n -To view all rules\n /Rules\n -To view statcaps:\n /statcap\n -To view 4th down rules:\n /4thdown\n ----STREAMS----\n -To post one Twitch stream:\n/twitch [username] [short description optional]\n -To post one Mixer stream:\n/mixer [username]\n -To post multiple streams at once (platform doesn't matter):\n /mstream [username]/[username]\n NOTE: '/' between usernames is REQUIRED.\n ----FOR FUN----\n Just try them out:\n /duck\n /salt\n /game\n /bg\n /clowning\n /bitch");
this.res.end();
}

else if(request.text && botRegexSchedule.test(request.text)) {
this.res.writeHead(200);
postMessage("http://daddyleagues.com/snd/schedules");
this.res.end();
}

else if(request.text && botRegexMulti.test(request.text)) {
this.res.writeHead(200);
postMessage("https://i.groupme.com/640x364.jpeg.f8a0e216bf7e42ed9a86b3ae23cc2ff1.large");
postMessage("https://multistre.am/"+request.text.substring(9,request.text.length)+"/layout4/");
this.res.end();
}
else if(request.text && botRegexStop.test(request.text)) {

else if(request.text && botRegexClown.test(request.text)) {
this.res.writeHead(200);
postMessage("Stop appropriating black culture");
postMessage("https://www.theclownschool.com/online-classes");
this.res.end();
}



else if(request.text && botRegexOh.test(request.text)) {
this.res.writeHead(200);
postMessage("https://i.groupme.com/640x458.jpeg.3b24480441b24aa3a67c3948cd4a7afd.large");
this.res.end();
}
else if(request.text && botRegexRiot.test(request.text)) {
this.res.writeHead(200);
postMessage("https://media.giphy.com/media/fDO2Nk0ImzvvW/giphy.gif");
this.res.end();
}
else if(request.text && botRegexProp.test(request.text)) {
Expand Down Expand Up @@ -62,7 +137,12 @@ function respond() {
this.res.writeHead(200);
postMessage("http://i.imgur.com/9V6ZnvD.png");
this.res.end();
}
}
else if(request.text && botRegexShady.test(request.text)) {
this.res.writeHead(200);
postMessage("https://media.giphy.com/media/uTw1Pf2CGuAHm/giphy.gif");
this.res.end();
}
else if(request.text && botRegexScrotes.test(request.text)) {
this.res.writeHead(200);
postMessage("https://i.groupme.com/1006x1340.jpeg.730381e4280e4028b8375432af14f39f.large");
Expand All @@ -76,19 +156,28 @@ function respond() {
else if(request.text && botRegexDL.test(request.text)) {
this.res.writeHead(200);
//postMessage("http://www.daddyleagues.com/maddenrating?name=&position=all&team="+request.text.substring(5,8));
postMessage("http://daddyleagues.com/maddenall32/team/"+request.text.substring(5,8)+"/depthchart");
postMessage("http://daddyleagues.com/snd/team/"+request.text.substring(5,8)+"/depthchart");
this.res.end();
}

else if(request.text && botRegexStandings.test(request.text)) {
this.res.writeHead(200);
postMessage("http://daddyleagues.com/snd/standings/league");
this.res.end();
}
else if(request.text && botRegexOW.test(request.text)) {
this.res.writeHead(200);
postMessage("www.daddyleagues.com/maddenrating/");
postMessage("www.daddyleagues.com/snd/maddenrating/");
this.res.end();
}
}
else if(request.text && botRegexSalt.test(request.text)) {
this.res.writeHead(200);
postMessage("https://i.imgur.com/B5BSVqH.png");
this.res.end();
}
else if(request.text && botRegexHype.test(request.text)) {
this.res.writeHead(200);
postMessage("https://media.giphy.com/media/2dto08eaL5vXO/giphy.gif");
this.res.end();
}
else if(request.text && botRegexAd.test(request.text)) {
this.res.writeHead(200);
Expand All @@ -97,7 +186,7 @@ function respond() {
}
else if(request.text && botRegexRules.test(request.text)) {
this.res.writeHead(200);
postMessage("https://docs.google.com/document/d/1hSuEG7oplnx4IX6HGsMOjsWb9TCqC4-F1NLjuBz5PCM/edit");
postMessage("http://daddyleagues.com/snd/rules");
this.res.end();
}
else if(request.text && botRegexGTA.test(request.text)) {
Expand All @@ -108,23 +197,65 @@ function respond() {
else if(request.text && botRegexSC.test(request.text)) {
this.res.writeHead(200);

postMessage("http://daddyleagues.com/maddenall32/team/"+request.text.substring(5,8)+"/schedule");
postMessage("http://daddyleagues.com/snd/team/"+request.text.substring(5,8)+"/schedule");
this.res.end();
}
else if(request.text && botRegexP.test(request.text)) {
this.res.writeHead(200);
var req = request.text.substring(5,request.text.length);
var rep = req.replace(/ /,"+");
postMessage("http://daddyleagues.com/maddenall32/players?name="+rep+"&position=all&team=all");

postMessage("http://daddyleagues.com/snd/players?name="+rep+"&position=all&team=all");
this.res.end();
}

else if(request.text && botRegex4thDown.test(request.text)) {
this.res.writeHead(200);
postMessage("-If you are on or past your opponents 35 yard line, and it is 4th & 2 or below, you may go for it \n -If you are up by 14 or more points you are not allowed to go for it This applies during any point of the match. \n -If you are losing by 14 or more points during the 3rd quarter you may go for it. \n -If you are losing by 3 or more points in the 4th quarter you may go for it. The down and distance does not matter in this situation. \n -If you are tied in the final two minutes of the 4th quarter you may go for it. The scenario must be sim related... just ask yourself if an NFL team would do it. \n -You are allowed one coaches decision a game. Any score, any quarter, regardless of field position. \n -You can attempt to convert a 4th down anywhere on the field, only if that conversion and new set of downs will allow you to run the game clock to 0:00 in the 4th quarter.");
this.res.end();
}

else if(request.text && botRegexStatCap.test(request.text)) {
this.res.writeHead(200);
postMessage("For a single player, do not exceed: \n 224 yards rushing \n 224 yards receiving \n 500 yards passing \n 4 rushing TDs \n 4 receiving TDs \n 5 passing TDs \n 5 sacks");
this.res.end();
}

else if(request.text && botRegexBitch.test(request.text)) {
this.res.writeHead(200);
postMessage("https://i.groupme.com/480x268.gif.4eee574ceacc4985ad3ff5047fb60adc.large");
this.res.end();
}

else if(request.text && botRegexGame.test(request.text)) {
this.res.writeHead(200);
postMessage("http://giphygifs.s3.amazonaws.com/media/d9ltR6odFmQsE/giphy.gif");
this.res.end();
}

else if(request.text && botRegexNoVance.test(request.text)) {
this.res.writeHead(200);
postMessage("https://media0.giphy.com/media/26uf82TQ93IGhfasU/giphy.gif");
this.res.end();
}

else if(request.text && botRegexTw.test(request.text)) {
this.res.writeHead(200);
postMessage("http://www.twitch.tv/"+request.text.substring(8,request.text.length));
this.res.end();
}

else if(request.text && botRegexMix.test(request.text)) {
this.res.writeHead(200);
postMessage("http://www.mixer.com/"+request.text.substring(8,request.text.length));
this.res.end();
}

else if(request.text && botRegexBG.test(request.text)) {
this.res.writeHead(200);
postMessage("https://i.kym-cdn.com/photos/images/original/000/802/696/6c6.jpg")
this.res.end();
}

else if(request.text && botRegexSb.test(request.text)) {
this.res.writeHead(200);
postMessage("http://www.reddit.com/r/maddenall32");
Expand Down Expand Up @@ -162,7 +293,7 @@ function respond() {
}
else if(request.text && botRegexTrade.test(request.text)) {
this.res.writeHead(200);
postMessage("https://docs.google.com/forms/d/e/1FAIpQLSdrbe5iBRaBC7EWoodVm8z6285-dG2EdHXAOMOgz8md8T1jwQ/viewform");
postMessage("https://docs.google.com/spreadsheets/d/1wzofmsbLnydmpdXlspA19IKE33l-OQBwzNaq_kduNVM/edit?ts=5e89e1ad#gid=699019273");
this.res.end();
}

Expand Down