Good Morning, I have a little problem. About the past week I have been working with NodeJS and currently writing a bot, which accepts incomming Steam Trade Offer. For this I use some steam-packages and socket.io. I have a function to check the items (souvenir, float, value, etc) and it is working correctly. After the server checked the whole offer, it is sending a socket to all connected clients.
// node-bot.js
socket.broadcast.emit('receiveOffer',{
value: totaldeposit,
offerid: offer.id,
items: offer.itemsToGive,
userid: offer.partner.getSteamID64()
});
Usually the user is receiving this socket - this is not the problem. After receiving the socket, i want to decline it directly (for debugging)
// app.js
socket.on('receiveOffer', function(data) {
console.log("Offer received: " + data);
socket.emit('declineOffer', {offerid:data.offerid});
});
My console is logging Offer received: [Object object]
.
But my server is not receiving this emitted socket declineOffer
. My function is looking like this:
socket.on('declineOffer', function(offer) {
console.log("declineOffer emitted ");
});
But the server is not printing my string declineOffer emitted
. What am i doing wrong? Is there something i should do differently?