Aswer Posted March 12, 2019 Report Share Posted March 12, 2019 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 Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted March 12, 2019 Report Share Posted March 12, 2019 Check the callback or promise result to redeemKey. Aswer 1 Quote Link to comment Share on other sites More sharing options...
Aswer Posted March 16, 2019 Author Report Share Posted March 16, 2019 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 Thank you for your time. Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted March 16, 2019 Report Share Posted March 16, 2019 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); } }); } }); Aswer 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.