Skip to content

Commit

Permalink
Merge pull request PhantomBot#2007 from IllusionaryOne/viewsTag
Browse files Browse the repository at this point in the history
Add (views) Tag to Custom Commands
  • Loading branch information
IllusionaryOne committed Jun 10, 2018
2 parents 3b9fae2 + 0b73907 commit 34537d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion javascript-source/commands/customCommands.js
Expand Up @@ -4,7 +4,7 @@
reCustomAPIJson = new RegExp(/\(customapijson ([\w\.:\/\$=\?\&\-]+)\s([\w\W]+)\)/), // URL[1], JSONmatch[2..n]
reCustomAPITextTag = new RegExp(/{([\w\W]+)}/),
reCommandTag = new RegExp(/\(command\s([\w]+)\)/),
tagCheck = new RegExp(/\(subscribers\)|\(age\)|\(sender\)|\(@sender\)|\(baresender\)|\(random\)|\(1\)|\(2\)|\(3\)|\(count\)|\(pointname\)|\(points\)|\(currenttime|\(price\)|\(#|\(uptime\)|\(follows\)|\(game\)|\(status\)|\(touser\)|\(echo\)|\(alert [,.\w]+\)|\(readfile|\(1=|\(countdown=|\(downtime\)|\(paycom\)|\(onlineonly\)|\(offlineonly\)|\(code=|\(followage\)|\(gameinfo\)|\(titleinfo\)|\(gameonly=|\(useronly=|\(playtime\)|\(gamesplayed\)|\(pointtouser\)|\(lasttip\)|\(writefile .+\)|\(runcode .+\)|\(readfilerand|\(commandcostlist\)|\(playsound |\(customapi |\(customapijson /),
tagCheck = new RegExp(/\(views\)|\(subscribers\)|\(age\)|\(sender\)|\(@sender\)|\(baresender\)|\(random\)|\(1\)|\(2\)|\(3\)|\(count\)|\(pointname\)|\(points\)|\(currenttime|\(price\)|\(#|\(uptime\)|\(follows\)|\(game\)|\(status\)|\(touser\)|\(echo\)|\(alert [,.\w]+\)|\(readfile|\(1=|\(countdown=|\(downtime\)|\(paycom\)|\(onlineonly\)|\(offlineonly\)|\(code=|\(followage\)|\(gameinfo\)|\(titleinfo\)|\(gameonly=|\(useronly=|\(playtime\)|\(gamesplayed\)|\(pointtouser\)|\(lasttip\)|\(writefile .+\)|\(runcode .+\)|\(readfilerand|\(commandcostlist\)|\(playsound |\(customapi |\(customapijson /),
customCommands = [],
ScriptEventManager = Packages.tv.phantombot.script.ScriptEventManager,
CommandEvent = Packages.tv.phantombot.event.command.CommandEvent;
Expand Down Expand Up @@ -66,6 +66,10 @@
}
}

if (message.match(/\(views\)/g)) {
message = $.replace(message, '(views)', $.twitchcache.getViews());
}

if (message.match(/\(gameonly=.*\)/g)) {
var game = message.match(/\(gameonly=(.*)\)/)[1];

Expand Down

0 comments on commit 34537d8

Please sign in to comment.