Jump to content
McKay Development

Recommended Posts

Posted

Hi, im new to this and i don't know how to check if the key is valid or invalid..

 

 

This is the code 

client.on("friendMessage", function (steamID, message) {
    if (steamID == AdminID && message.indexOf('!key') == 0) {
        var GetKey = message.replace('!key ', '');
        client.redeemKey(GetKey);
        client.chatMessage(steamID, "Key activated: " + GetKey);
    }
});

Thanks  :D

Posted

Check the callback or promise result to redeemKey.

 

Thank you but.. i'm new to this stuff and I searched everywhere to find an example...

Can you plase help me with an small example  :D

 

Thank you for your time.

Posted

client.on("friendMessage", function (steamID, message) {
if (steamID == AdminID && message.indexOf('!key') == 0) {
var GetKey = message.replace('!key ', '');
client.redeemKey(GetKey, function (err) {
if (err) {
// key not activated
} else {
client.chatMessage(steamID, "Key activated: " + GetKey);
}
});
}
});

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...