-
Notifications
You must be signed in to change notification settings - Fork 1
/
Eauth.py
322 lines (287 loc) · 10.4 KB
/
Eauth.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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
import interactions
import requests
import os
import json
# Required configuration
bottoken = "" # Your Discord bot token
appkey = "" # Your application key goes here
acckey = "" # Your account key goes here
appid = "" # Your application ID goes here
apptoken = "" # Your application token goes here
bot = interactions.Client(token=bottoken)
@bot.command(
name="userid",
description="Displays the user ID",
)
async def userid(ctx: interactions.CommandContext):
await ctx.send(f"User ID: `{ctx.author.id}`")
@bot.command(
name="serverid",
description="Displays the server ID",
)
async def serverid(ctx: interactions.CommandContext):
await ctx.send(f"Server ID: `{ctx.guild.id}`")
@bot.command(
name="getvar",
description="Getting value of a server-sided variable",
options=[
interactions.Option(
name="varid",
description="Your Variable ID",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def getvar(ctx: interactions.CommandContext, varid: str):
var = varid
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=variable&varid=" +
var + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid + "",
headers=headers)
await ctx.send(response.text)
@bot.command(
name="genkey",
description="Generate a new key",
options=[
interactions.Option(
name="length",
description="Length of the key (9 ~ 16)",
type=interactions.OptionType.STRING,
required=True,
),
interactions.Option(
name="rank",
description="Rank given to the key",
type=interactions.OptionType.STRING,
required=True,
),
interactions.Option(
name="expire",
description="Expire duration of the key",
type=interactions.OptionType.STRING,
required=True,
),
interactions.Option(
name="prefix",
description="Prefix of the key",
type=interactions.OptionType.STRING,
required=False, # Set required to False to make it optional
),
],
)
async def genkey(ctx: interactions.CommandContext, rank: str, expire: str,
length: str, prefix: str = ""): # Set prefix to an empty string as default value
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=genkey&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&rank=" + rank + "&expire=" + expire + "&length=" +
length + "&prefix=" + prefix + "",
headers=headers)
await ctx.send(response.text)
@bot.command(
name="delkey",
description="Delete a key",
options=[
interactions.Option(
name="key",
description="The key you wish to delete",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def delkey(ctx: interactions.CommandContext, key: str):
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=delkey&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&keyid=" + key + "",
headers=headers)
await ctx.send(f"{response.text}")
@bot.command(
name="delvar",
description="Delete a variable",
options=[
interactions.Option(
name="varname",
description="The variable you wish to delete",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def delvar(ctx: interactions.CommandContext, varname: str):
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=delvar&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&varname=" + varname + "",
headers=headers)
await ctx.send(f"{response.text}")
@bot.command(
name="addvar",
description="Add a variable",
options=[
interactions.Option(
name="varname",
description="A name your want",
type=interactions.OptionType.STRING,
required=True,
),
interactions.Option(
name="varvalue",
description="A value your want",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def addvar(ctx: interactions.CommandContext, varname: str,
varvalue: str):
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=addvar&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&varname=" + varname + "&varvalue=" + varvalue + "",
headers=headers)
await ctx.send(f"{response.text}")
@bot.command(
name="adduser",
description="Add a new user account",
options=[
interactions.Option(
name="username",
description="A name given to the user",
type=interactions.OptionType.STRING,
required=True,
),
interactions.Option(
name="password",
description="Password for the user account",
type=interactions.OptionType.STRING,
required=True,
),
interactions.Option(
name="rank",
description="Rank given to the user",
type=interactions.OptionType.STRING,
required=True,
),
interactions.Option(
name="expire",
description="Expire duration of the user account",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def adduser(ctx: interactions.CommandContext, username: str,
password: str, rank: str, expire: str):
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=adduser&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&username=" + username + "&password=" + password +
"&rank=" + rank + "&expire=" + expire + "",
headers=headers)
parts = response.text.split('|')
message = '\n'.join(parts)
await ctx.send(message)
@bot.command(
name="deluser",
description="Delete a user",
options=[
interactions.Option(
name="username",
description="The user you wish to delete",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def deluser(ctx: interactions.CommandContext, username: str):
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=deluser&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&username=" + username + "",
headers=headers)
await ctx.send(f"{response.text}")
@bot.command(
name="keydata",
description="Obtain the properties of a key based on its ID",
options=[
interactions.Option(
name="keyid",
description="Your Key ID",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def keydata(ctx: interactions.CommandContext, keyid: str):
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=keydata&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&keyid=" + keyid + "",
headers=headers)
parts = response.text.split('|')
message = '\n'.join(parts)
await ctx.send(message)
@bot.command(
name="userdata",
description="Obtain the properties of a user based on its name",
options=[
interactions.Option(
name="username",
description="Name of the account",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def userdata(ctx: interactions.CommandContext, username: str):
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=userdata&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&username=" + username + "",
headers=headers)
parts = response.text.split('|')
message = '\n'.join(parts)
await ctx.send(message)
@bot.command(
name="resethwid",
description="Reassigning the hardware ID for a user account to default",
options=[
interactions.Option(
name="username",
description="The user you wish to reset",
type=interactions.OptionType.STRING,
required=True,
),
],
)
async def resethwid(ctx: interactions.CommandContext, username: str):
headers = {"User-Agent": "eauth"}
userid = str(ctx.author.id)
serverid = str(ctx.guild.id)
response = requests.get("https://eauth.us.to/api/command.php?sort=hwidreset&appid=" +
appid + "&appkey=" + appkey + "&acckey=" + acckey + "&apptoken=" + apptoken + "&appid=" + appid + "&userid=" + userid + "&serverid=" + serverid +
"&username=" + username + "",
headers=headers)
await ctx.send(response.text)
bot.start() # Launch the bot