bossikkk Posted September 29, 2017 Report Posted September 29, 2017 in class Bot: confirmTrade(offer_id) { return new Promise((resolve, reject) => { this.community.acceptConfirmationForObject(this.identity_secret, offer_id, (err) => { console.log(this.identity_secret); console.log(offer_id); if (!err) { return resolve("Successfully confirmed trade #" + offer_id); } else { return reject(err.message); } }); }); }Call: bot.confirmTrade(2541735824).then(resultAccepting => { console.log(resultAccepting); }).catch(errAccepting => { console.log(errAccepting); });I use SDA and get identity_secret from maFile. Don't know why code not work. I see identity_secret and offer_id in console, but i receiving "Could not find confirmation for object". Quote
Dr. McKay Posted September 29, 2017 Report Posted September 29, 2017 Have you sent/accepted the offer already? Quote
bossikkk Posted October 1, 2017 Author Report Posted October 1, 2017 (edited) Have you sent/accepted the offer already? Yeah I forgot to add: offer.accept(function(err, status) { if (err) { console.log(err.message); return; } console.log("Current trade status: " + status); }); in newOffer event. Now it's work perfectly. So that not to create another topic. You can tell me how to do anti-spam in event friendMessage? For example stop event on 10 sec and in this time other !commands won't work. Edited October 1, 2017 by bossikkk 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.