Jump to content
McKay Development

code to initialize last accepted offer

Recommended Posts

I there any code/function to detect last accepted offer and say what was opponents trade link ??? The reason why do I need it is because when 2 different users got offers, and 1 of them accepts the trade, bot doesnt know who confirmed, (but registered that someone confirmed) so bot sends them both message like "Success trade confirmed


Edited by EnelGy
Link to post
Share on other sites

Could you please help me ?? So how could I prevent that bot will not respond both users when only 1 user confirmed the trade offer ??

It is really frustrating to see it and really dont know how to prevent it

in chat it looks like this: (1 - user "EnelGy" accepted the trade, 2 - user "Command" wrote the same command, but didnt accept the trade...)


And if the user who won accept the trade that bot is sending his winnings, it resets(like he registered sentOfferChanged() - accepted offer) and generates another game where also are 2 users:

After accepting the win: this is constant.... so bot will end sending winning trades after his inv is empty or bots users lose

 Btw I am storing users trade link inside some json file so there could be some call function (each user is signed there with his discord id and has there trade link in strings









Edited by EnelGy
Link to post
Share on other sites

But what if I want it to have that handler on specific trade ? 

There are 2 diffrent sending trades functions, first is the bot doesnt give anything, and this i want to check if is confirmed, second is the bot is giving..

(I have solved it wuth adding if statements on itemstogive == 0)

1. How can I know that first sent trade offer is matching with some id ?? like if (offer.id === ______)...

I need something that says if (offer.id.state === "accepted"), but this code wont work, how can i do it ??

2. Some developer told that i can fix this using polldata, is it possible ??




Edited by EnelGy
Link to post
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.

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.

  • Create New...