repl.it
@21natzil/

Steam Donation Bot

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# This program will not save any of your information, just look at the source!

import time

from steampy import client, login
import replit
from requests import Session

POLL_DELAY = 20

name = input("Username: ")
pasw = input("Password (WARNING, YOU WILL BE ABLE TO SEE IT): ")
apikey = input("API key (steamcommunity.com/dev/apikey): ")
one_time_code = input("One Time Code (blank if N/A): ")

replit.clear()

print("Starting Program...")

sess = login.LoginExecutor(name, pasw, '', Session())
sess.one_time_code = one_time_code
sess.login()

client = client.SteamClient(apikey)
client._session = sess.session
client.was_login_executed = True
client.steam_guard = {}

while True:
  print("Looking for trades...")
  trades = client.get_trade_offers()
  for offer in trades['response']['trade_offers_received']:
    if not offer['items_to_give']:
      print("Found gift! Accepting.")
      try:
        client.accept_trade_offer(offer['tradeofferid'])
      except KeyError:
        pass
  print("Waiting {sec} seconds".format(sec=POLL_DELAY))
  time.sleep(POLL_DELAY)