Closed samuri51 closed 11 years ago
nevermind figured this one out
Thanks for sharing -_-
here ya go dude :), didn't know anyone was interested, should be able to use it as is
heres the format:
use space and @ symbol or two spaces in between the persons name
/userid @DubbyTT
the number after it should be a valid userid and u need one space
/username 152151251515111
bot.on('speak', function (data)
{
var text = data.text;
if (text.match('/userid'))
{
var ban8 = data.text.slice(9);
var checkUser8 = bot.getUserId(ban8, function (data)
{
var userid56 = data.userid;
if (typeof (userid56) !== 'undefined')
{
bot.speak(userid56);
}
else
{
bot.speak('I\'m sorry that userid is undefined');
}
});
}
else if (text.match('/username'))
{
var ban50 = data.text.slice(10);
var tmp94 = bot.getProfile(ban50, function (data)
{
bot.speak(data.name);
});
}
});
there i added it to the wiki since it seemed like something that everyone should know how to do
so i'm trying to write something like
if getUserId ( name:string, callback:fn ) === undefined than do nothing else give the information
but it seems no matter what i do i get the retarded undefined msg.tostring error
anyone know how to do this?