Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
A plugin for leader1 to like tracks when people say TTTTTUUUUUUUUNNNNNNNNNEEEEEE or a variant thereof
RegisterCallback("PRIVMSG", "TUUUUUUUUNE", function() {
var msg = this.event.message,
args = msg.split(" "),
source = this.event.args[0],
nick = this.event.nick,
me = IRC.GetNick(),
stats = UTILS.GetShoutcastStats(),
cfg = GetConfig();
if(nick != me && msg.match(/T(U+)(N+)E/) && !msg.match(/^!/)) {
if(UTILS.LikeTrack(nick, stats.SongTitle)) {
IRC.Privmsg(source, nick+": thanks, you liked `"+stats.SongTitle+"`");
IRC.Privmsg(cfg.Irc.StaffChannel, "LIKE: "+nick+" liked `"+stats.SongTitle+"`");
} else {
IRC.Privmsg(cfg.Irc.StaffChannel, "LIKE: "+nick+" liked `"+args.join(" ")+"` (database insert failed)");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment