0

I'm not a coder, but I'm asking on behalf of my web developer who isn't fluent with english, for everyone's expertise.

I'm trying to achieve a real time trade notification on my website.

I have the node.js bot working for all trading purpose already and its interacting with the web with socket.io. Inventory is working. But I do want to add an addtional functionality when the trade offer is send, a notification will also in real time event sent to user on my website at the same time my bot sent a trade offer to the user in steam.

Below is a screenshot example,

https://gyazo.com/ec41e836605f2284f834dd7606693e22

Really appreciate if anyone could help me out.

  • Nobody will be able to answer this well without sample code of whatever he's attempted so far. Otherwise, he might as well just go research on socket.io tutorials and whatnot. – Paul Apr 20 '16 at 13:52

1 Answers1

0

This all depends on the way you handle your data.

If you are making it so the bot sends a trade offer to the user then when you call your trade offer add in a

socket.emit('tradeOfferSent', {

});

to that user which can be picked up on the client side by

socket.on('tradeOfferSent',function(data) {

});

conversely if you are making your users send trade offers to the bot you can use on 'newOffer' from steam-tradeoffer-manager to emit the data as above.

Inside the on.socket('',function(){}); you are able to add anything you want as an notification. Such as using sweetalerts.

Matt
  • 1,749
  • 2
  • 12
  • 26