Doggy Doggo
Member
Hey guys I currently have a script that changes the nick of the bot to the song title. It works for requested songs and for YouTube. Now it works for when I switch to radio, but when the song changes on the radio it doesn't update. Is there anyway I can do this? This is the code so far. Any help would be greatly appreciated. Thanks in advance.
Code:
registerPlugin({
name: 'Set Bot Name To Song Title',
version: '1.0',
description: 'Changes the bots song title for requested songs, radio and YouTube™.',
author: 'Smallo',
vars: {}
}, function (sinusbot, config) {
var fulltitle;
sinusbot.on('track', function(ev) {
if (fulltitle = ev.tempTitle) {
//Nothing
} else if (fulltitle = ev.title){
//Nothing
} else {
if (typeof ev.tempTitle != 'undefined'){
fulltitle = ev.tempTitle;
} else if (ev.title != 'undefined') {
fulltitle = ev.title;
}
}
if (fulltitle.length > 27){
fulltitle = fulltitle.substring(0,26);
}
var nick = '♫ ' + fulltitle + ' ♫';
setNick(nick);
});
sinusbot.on('trackEnd', function(ev) {
if (typeof ev.tempTitle != 'undefined'){
fulltitle = ev.tempTitle;
} else if (ev.title != 'undefined') {
fulltitle = ev.title;
}
});
});