steampy
steampy copied to clipboard
Invalid trade offer state: ConfirmationNeed (9) Please help me 🙏 🙏 🙏
Hello, dear author. First of all, I would like to thank you for your hard work and the work that you have done, really thank you...
Could you help me? When confirming the SENT offer, I get this error
Traceback (most recent call last):
File "c:\Users\User\Desktop\new(3)\main.py", line 5, in
My code:
steam_client = SteamClient(f'{API_STEAM}')
steam_client.login(f'{LOGIN_STEAM}', f'{PASSWORD_STEAM}', 'Steam/steam_guard.json')
steam_client.accept_trade_offer('6628868099')
Please help me 🙏 🙏 🙏
If you are submitting a proposal, use steam_client._confirm_transaction(tradeofferid)
Если вы отправляете предложение, используйте steam_client._confirm_transaction(tradeofferid)
Thank you very much for trying to help, but unfortunately it did not help(( It still gives an error, although it is already different ((In general, it is very strange, because just recently the accept_trade_offer() method worked for me, but then abruptly stopped with the error that I wrote at the beginning of the message((
steam_client._confirm_transaction(trade_id)
File "C:\Program Files (x86)\Python310\lib\site-packages\steampy\client.py", line 287, in _confirm_transaction return confirmation_executor.send_trade_allow_request(trade_offer_id) File "C:\Program Files (x86)\Python310\lib\site-packages\steampy\confirmation.py", line 37, in send_trade_allow_request confirmations = self._get_confirmations() File "C:\Program Files (x86)\Python310\lib\site-packages\steampy\confirmation.py", line 60, in _get_confirmations for conf in confirmations_json['conf']: KeyError: 'conf'
My code: `steam_client = SteamClient(f'{API_KEY}') steam_client.login(login, pass, 'Steam/steam_guard.json')
trade_id = '6758267057' steam_client._confirm_transaction(trade_id)`
I take the exchanges from here: https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key={API_KEY}&get_received_offers=1
If you are trying to confirm a RECEIVED trade, then using steam_client.accept_trade_offer(tradeofferid) was correct. Since you are using: https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key={API_KEY}&get_received_offers=1
Usage steam_client._confirm_transaction(tradeofferid) follows when using: https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key={API_KEY}&get_sent_offers=1
To get only active offers use active_only=1 : https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key={API_KEY}&get_received_offers=1&active_only=1
To better see what the problem is, run your code this way:
steam_client = SteamClient(f"{API_KEY}")
steam_client.login(login, pass, "Steam/steam_guard.json")
trade_id = "6758267057"
try:
steam_client.accept_trade_offer(trade_id)
except Exception as e:
print(f"Error accept_trade_offer: {e}")
Если вы пытаетесь подтвердить ПОЛУЧЕННУЮ сделку, значит, использование steam_client.accept_trade_offer(tradeofferid) было правильным. Поскольку вы используете: https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key={API_KEY}&get_received_offers= 1
Использование steam_client._confirm_transaction(tradeofferid) следует при использовании: https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key={API_KEY}&get_sent_offers= 1
Чтобы получать только активные предложения, используйте active_only= 1 : https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key={API_KEY}&get_received_offers=1&active_only=1
Чтобы лучше понять, в чем проблема, запустите свой код следующим образом:
steam_client = SteamClient(f"{API_KEY}") steam_client.login(login, pass, "Steam/steam_guard.json") trade_id = "6758267057" try: steam_client.accept_trade_offer(trade_id) except Exception as e: print(f"Error accept_trade_offer: {e}")
Thank you so much for helping me<3 I did as you said. I took the tradeofferid from here: https://api.steampowered.com/IEconService/GetTradeOffers/v1/?key={API_KEY}&get_received_offers=1&active_only=1
However, I got an error again, this time like this:
Error accept_trade_offer: substring not found