Skip to content

Instantly share code, notes, and snippets.

@darkliquid
Last active August 29, 2015 14:02
Show Gist options
  • Save darkliquid/3b27e1ba5bb220023498 to your computer and use it in GitHub Desktop.
Save darkliquid/3b27e1ba5bb220023498 to your computer and use it in GitHub Desktop.
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