Aswer Posted March 12, 2019 Report 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
Dr. McKay Posted March 12, 2019 Report Posted March 12, 2019 Check the callback or promise result to redeemKey. Aswer 1 Quote
Aswer Posted March 16, 2019 Author Report 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
Dr. McKay Posted March 16, 2019 Report 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
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.