-
Notifications
You must be signed in to change notification settings - Fork 97
Find anyone's userid on turntable
This is useful if you have a troll that joins your room and leaves before you can ban them. with their userid you can make sure that they stay away no matter what they change their name to.
the second command /username is useful if you have a bunch of userid's laying around and you don't know who they belong to, just punch them into that and it'll show their name as long as they're a registered user of turntable.fm
everything needed to make these two commands work is shown.
For the first command /userid: use a space and an @ symbol, or two spaces in between the persons name and the command. The name must be spelled exactly correct. The @ symbol is useful if they are in your room because turntable knows to autofill the name for you.
how it looks: /userid @nacheese
the output: 4ef7a09c590ca23e2d0013c1
For the second command /username: The number after it should be a valid userid and you need one space.
how it looks: /username 4ef7a09c590ca23e2d0013c1
the output: nacheese
bot.on('speak', function(data) {
var text = data.text; //the chatbox on turntable
if (text.match(/^\/userid/)) {
var ban8 = data.text.slice(9); //this holds the persons name
var checkUser8 = bot.getUserId(ban8, function(data1) {
var userid56 = data1.userid; //the person's userid
if (typeof userid56 !== 'undefined') { //if successful callback then say userid
bot.speak(userid56);
} else {
bot.speak('error, please enter a valid name'); //else, name was invalid
}
});
} else if (text.match(/^\/username/)) {
var ban50 = data.text.slice(10); //holds persons userid
var tmp94 = bot.getProfile(ban50, function(data2) {
bot.speak(data2.name); //if sucessful callback, say persons name
});
}
});