forked from SteveHuiz/vk-slaves-python-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.py
More file actions
88 lines (75 loc) · 2.23 KB
/
api.py
File metadata and controls
88 lines (75 loc) · 2.23 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import time
import random
import requests # pip install requests
from run import client
from config import settings
# //////////////////////////////////////////////////////////////////////////////
# //////////////////////////////////////////////////////////////////////////////
# Default Calls using API //////////////////////////////////////////////////////
def do_start():
try:
start = client.start()
return start
except Exception as e:
print(str(e))
time.sleep(15)
return do_start()
def get_user(id):
try:
user = client.user(id=id)
return user
except Exception as e:
print(str(e))
time.sleep(15)
return get_user(id)
def get_slaves(id):
try:
slaves = client.slave_list(id=id)
return slaves
except Exception as e:
print(str(e))
time.sleep(15)
return get_slaves(id)
def buy(id):
try:
a_buy = client.buy_slave(slave_id=id)
return a_buy
except Exception as e:
print(str(e))
time.sleep(15)
return buy(id)
def make_job(id):
try:
job = client.job_slave(slave_id=id, job_name=settings['job_slaves']['JOBS'][random.randrange(0, len(settings['job_slaves']['JOBS']))])
return job
except Exception as e:
print(str(e))
time.sleep(15)
return make_job(id)
def fetter(id):
try:
a_fetter = client.buy_fetter(slave_id=id)
return a_fetter
except Exception as e:
print(str(e))
time.sleep(15)
return fetter(id)
def sale(id):
try:
a_sale = client.sale_slave(slave_id=id)
return a_sale
except Exception as e:
print(str(e))
time.sleep(15)
return sale(id)
def get_top():
try:
top = client.top_users()
return top
except Exception as e:
print(str(e))
time.sleep(15)
return get_top()
# //////////////////////////////////////////////////////////////////////////////
# //////////////////////////////////////////////////////////////////////////////
# //////////////////////////////////////////////////////////////////////////////