Jump to content
McKay Development

not triggering sentOfferChanged state #2 on trades only requesting items.


Recommended Posts

This is driving me crazy, basically when my bot crates a trade that doesn't contain any of the bots items (aka only requesting items from the end user) it fails to trigger sentOfferChanged state #2, but when the trade contains any of the bots items it will trigger state #2.

 

I want state 2 so I can send a quick link to the trade, and it works fine aslong as the trade has any of the bots items within it.

 

Also is it sending the items fine, I see the trade offer if I look on steam for it, but simply do not get the #2 state within the bot.

 

Here is an example:

https://i.imgur.com/IRyhbzj.png

 

Whats happening here is:

- !takecards is requesting 10 cards from the bot, as you see it gets state 2 (and sends a link to the trade <like so)

- I decline

- !givecards makes the bot request 10 cards from me, as you see it fails to trigger state 2, but it did send the trade if I look at steam

- I decline, and as seen from the oldState is says 2, but bot never trigger the #2 state..

 

what could I be missing?

manager.on("sentOfferChanged", (offer, oldState) => {
	log("sentOfferChanged - ID: #"+offer.id+", state: "+offer.state+", oldState: "+oldState);
	if (offer.state == 2) {
		log("Trade sent..");
		sendMessage(offer.partner, msg.TradeOfferSent.replace("{url}", "https://steamcommunity.com/tradeoffer/"+offer.id));
	} else if (offer.state == 3) {
		log("Trade finished..");
		sendMessage(offer.partner, msg.TradeOfferThanks);
		playStatus();
	} else if (offer.state == 7) {
		log("Trade declined..");
	}
}); 

For kicks I also tried using the equivalent with confirmationAccepted to see if that triggers state #2 but it results in the same behavior, just doesn't make sense to me that it will only trigger state 2 when and only when bot's items are in the trade. :/

 

 

edit; after brainstorming for a bit, I suspect since its not offering items perhaps its immediately state 2 by default thus no sentOfferChanged since nothing "changed"?, perhaps I need some fancy callback within offer.send()?

Edited by Schmaltz
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...