-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathMain.py
1901 lines (1729 loc) · 69 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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
class SELFBOT():
__linecount__ = 1933
__version__ = 3.4
import discord, subprocess, sys, time, os, colorama, base64, codecs, datetime, io, random, numpy, datetime, smtplib, string, ctypes
import urllib.parse, urllib.request, re, json, requests, webbrowser, aiohttp, dns.name, asyncio, functools, logging
from discord.ext import (
commands,
tasks
)
from bs4 import BeautifulSoup as bs4
from urllib.parse import urlencode
from pymongo import MongoClient
from selenium import webdriver
from threading import Thread
from subprocess import call
from itertools import cycle
from colorama import Fore
from sys import platform
from PIL import Image
import pyPrivnote as pn
from gtts import gTTS
ctypes.windll.kernel32.SetConsoleTitleW(f'[Alucard Selfbot v{SELFBOT.__version__}] | Loading...')
with open('config.json') as f:
config = json.load(f)
token = config.get('token')
password = config.get('password')
prefix = config.get('prefix')
giveaway_sniper = config.get('giveaway_sniper')
slotbot_sniper = config.get('slotbot_sniper')
nitro_sniper = config.get('nitro_sniper')
privnote_sniper = config.get('privnote_sniper')
stream_url = config.get('stream_url')
tts_language = config.get('tts_language')
bitly_key = config.get('bitly_key')
cat_key = config.get('cat_key')
weather_key = config.get('weather_key')
cuttly_key = config.get('cuttly_key')
width = os.get_terminal_size().columns
hwid = subprocess.check_output('wmic csproduct get uuid').decode().split('\n')[1].strip()
start_time = datetime.datetime.utcnow()
loop = asyncio.get_event_loop()
languages = {
'hu' : 'Hungarian, Hungary',
'nl' : 'Dutch, Netherlands',
'no' : 'Norwegian, Norway',
'pl' : 'Polish, Poland',
'pt-BR' : 'Portuguese, Brazilian, Brazil',
'ro' : 'Romanian, Romania',
'fi' : 'Finnish, Finland',
'sv-SE' : 'Swedish, Sweden',
'vi' : 'Vietnamese, Vietnam',
'tr' : 'Turkish, Turkey',
'cs' : 'Czech, Czechia, Czech Republic',
'el' : 'Greek, Greece',
'bg' : 'Bulgarian, Bulgaria',
'ru' : 'Russian, Russia',
'uk' : 'Ukranian, Ukraine',
'th' : 'Thai, Thailand',
'zh-CN' : 'Chinese, China',
'ja' : 'Japanese',
'zh-TW' : 'Chinese, Taiwan',
'ko' : 'Korean, Korea'
}
locales = [
"da", "de",
"en-GB", "en-US",
"es-ES", "fr",
"hr", "it",
"lt", "hu",
"nl", "no",
"pl", "pt-BR",
"ro", "fi",
"sv-SE", "vi",
"tr", "cs",
"el", "bg",
"ru", "uk",
"th", "zh-CN",
"ja", "zh-TW",
"ko"
]
m_numbers = [
":one:",
":two:",
":three:",
":four:",
":five:",
":six:"
]
m_offets = [
(-1, -1),
(0, -1),
(1, -1),
(-1, 0),
(1, 0),
(-1, 1),
(0, 1),
(1, 1)
]
def startprint():
if giveaway_sniper == True:
giveaway = "Active"
else:
giveaway = "Disabled"
if nitro_sniper == True:
nitro = "Active"
else:
nitro = "Disabled"
if slotbot_sniper == True:
slotbot = "Active"
else:
slotbot = "Disabled"
if privnote_sniper == True:
privnote = "Active"
else:
privnote = "Disabled"
print(f'''{Fore.RESET}
▄▄▄ ██▓ █ ██ ▄████▄ ▄▄▄ ██▀███ ▓█████▄
▒████▄ ▓██▒ ██ ▓██▒▒██▀ ▀█ ▒████▄ ▓██ ▒ ██▒▒██▀ ██▌
▒██ ▀█▄ ▒██░ ▓██ ▒██░▒▓█ ▄ ▒██ ▀█▄ ▓██ ░▄█ ▒░██ █▌
░██▄▄▄▄██ ▒██░ ▓▓█ ░██░▒▓▓▄ ▄██▒░██▄▄▄▄██ ▒██▀▀█▄ ░▓█▄ ▌
▓█ ▓██▒░██████▒▒▒█████▓ ▒ ▓███▀ ░ ▓█ ▓██▒░██▓ ▒██▒░▒████▓
▒▒ ▓▒█░░ ▒░▓ ░░▒▓▒ ▒ ▒ ░ ░▒ ▒ ░ ▒▒ ▓▒█░░ ▒▓ ░▒▓░ ▒▒▓ ▒
▒ ▒▒ ░░ ░ ▒ ░░░▒░ ░ ░ ░ ▒ ▒ ▒▒ ░ ░▒ ░ ▒░ ░ ▒ ▒
░ ▒ ░ ░ ░░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
{Fore.CYAN}Alucard {SELFBOT.__version__} | {Fore.GREEN}Logged in as: {Alucard.user.name}#{Alucard.user.discriminator} {Fore.CYAN}| ID: {Fore.GREEN}{Alucard.user.id}
{Fore.CYAN}Privnote Sniper | {Fore.GREEN}{privnote}
{Fore.CYAN}Nitro Sniper | {Fore.GREEN}{nitro}
{Fore.CYAN}Giveaway Sniper | {Fore.GREEN}{giveaway}
{Fore.CYAN}SlotBot Sniper | {Fore.GREEN}{slotbot}
{Fore.CYAN}Prefix: {Fore.GREEN}{prefix}
{Fore.CYAN}Creator(open-source on github): {Fore.GREEN}coats.#4321
'''+Fore.RESET)
def Clear():
os.system('cls')
Clear()
def Init():
if config.get('token') == "token-here":
Clear()
print(f"{Fore.RED}[ERROR] {Fore.YELLOW}You didnt put your token in the config.json file"+Fore.RESET)
else:
token = config.get('token')
try:
Alucard.run(token, bot=False, reconnect=True)
os.system(f'title (Alucard Selfbot) - Version {SELFBOT.__version__}')
except discord.errors.LoginFailure:
print(f"{Fore.RED}[ERROR] {Fore.YELLOW}Improper token has been passed"+Fore.RESET)
os.system('pause >NUL')
def GmailBomber():
_smpt = smtplib.SMTP('smtp.gmail.com', 587)
_smpt.starttls()
username = input('Gmail: ')
password = input('Gmail Password: ')
try:
_smpt.login(username, password)
except:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW} Incorrect Password or gmail, make sure you've enabled less-secure apps access"+Fore.RESET)
target = input('Target Gmail: ')
message = input('Message to send: ')
counter = eval(input('Ammount of times: '))
count = 0
while count < counter:
count = 0
_smpt.sendmail(username, target, message)
count += 1
if count == counter:
pass
def GenAddress(addy: str):
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
four_char = ''.join(random.choice(letters) for _ in range(4))
should_abbreviate = random.randint(0,1)
if should_abbreviate == 0:
if "street" in addy.lower():
addy = addy.replace("Street", "St.")
addy = addy.replace("street", "St.")
elif "st." in addy.lower():
addy = addy.replace("st.", "Street")
addy = addy.replace("St.", "Street")
if "court" in addy.lower():
addy = addy.replace("court", "Ct.")
addy = addy.replace("Court", "Ct.")
elif "ct." in addy.lower():
addy = addy.replace("ct.", "Court")
addy = addy.replace("Ct.", "Court")
if "rd." in addy.lower():
addy = addy.replace("rd.", "Road")
addy = addy.replace("Rd.", "Road")
elif "road" in addy.lower():
addy = addy.replace("road", "Rd.")
addy = addy.replace("Road", "Rd.")
if "dr." in addy.lower():
addy = addy.replace("dr.", "Drive")
addy = addy.replace("Dr.", "Drive")
elif "drive" in addy.lower():
addy = addy.replace("drive", "Dr.")
addy = addy.replace("Drive", "Dr.")
if "ln." in addy.lower():
addy = addy.replace("ln.", "Lane")
addy = addy.replace("Ln.", "Lane")
elif "lane" in addy.lower():
addy = addy.replace("lane", "Ln.")
addy = addy.replace("lane", "Ln.")
random_number = random.randint(1,99)
extra_list = ["Apartment", "Unit", "Room"]
random_extra = random.choice(extra_list)
return four_char + " " + addy + " " + random_extra + " " + str(random_number)
def BotTokens():
with open('Data/Tokens/bot-tokens.txt', 'a+') as f:
tokens = {token.strip() for token in f if token}
for token in tokens:
yield token
def UserTokens():
with open('Data/Tokens/user-tokens.txt', 'a+') as f:
tokens = {token.strip() for token in f if token}
for token in tokens:
yield token
class Login(discord.Client):
async def on_connect(self):
guilds = len(self.guilds)
users = len(self.users)
print("")
print(f"Connected to: [{self.user.name}]")
print(f"Token: {self.http.token}")
print(f"Guilds: {guilds}")
print(f"Users: {users}")
print("-------------------------------")
await self.logout()
def _masslogin(choice):
if choice == 'user':
for token in UserTokens():
loop.run_until_complete(Login().start(token, bot=False))
elif choice == 'bot':
for token in BotTokens():
loop.run_until_complete(Login().start(token, bot=True))
else:
return
def async_executor():
def outer(func):
@functools.wraps(func)
def inner(*args, **kwargs):
thing = functools.partial(func, *args, **kwargs)
return loop.run_in_executor(None, thing)
return inner
return outer
@async_executor()
def do_tts(message):
f = io.BytesIO()
tts = gTTS(text=message.lower(), lang=tts_language)
tts.write_to_fp(f)
f.seek(0)
return f
def Dump(ctx):
for member in ctx.guild.members:
f = open(f'Images/{ctx.guild.id}-Dump.txt', 'a+')
f.write(str(member.avatar_url)+'\n')
def Nitro():
code = ''.join(random.choices(string.ascii_letters + string.digits, k=16))
return f'https://discord.gift/{code}'
def RandomColor():
randcolor = discord.Color(random.randint(0x000000, 0xFFFFFF))
return randcolor
def RandString():
return "".join(random.choice(string.ascii_letters + string.digits) for i in range(random.randint(14, 32)))
colorama.init()
Alucard = discord.Client()
Alucard = commands.Bot(
description='Alucard Selfbot',
command_prefix=prefix,
self_bot=True
)
Alucard.remove_command('help')
@tasks.loop(seconds=3)
async def btc_status():
r = requests.get('https://api.coindesk.com/v1/bpi/currentprice/btc.json').json()
value = r['bpi']['USD']['rate']
await asyncio.sleep(3)
btc_stream = discord.Streaming(
name="Current BTC price: "+value+"$ USD",
url="https://www.twitch.tv/monstercat",
)
await Alucard.change_presence(activity=btc_stream)
@Alucard.event
async def on_command_error(ctx, error):
error_str = str(error)
error = getattr(error, 'original', error)
if isinstance(error, commands.CommandNotFound):
return
elif isinstance(error, commands.CheckFailure):
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}You're missing permission to execute this command"+Fore.RESET)
elif isinstance(error, commands.MissingRequiredArgument):
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}Missing arguments: {error}"+Fore.RESET)
elif isinstance(error, numpy.AxisError):
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}Not a valid image"+Fore.RESET)
elif isinstance(error, discord.errors.Forbidden):
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}Discord error: {error}"+Fore.RESET)
elif "Cannot send an empty message" in error_str:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}Couldnt send a empty message"+Fore.RESET)
else:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{error_str}"+Fore.RESET)
@Alucard.event
async def on_message_edit(before, after):
await Alucard.process_commands(after)
@Alucard.event
async def on_message(message):
def GiveawayData():
print(
f"{Fore.WHITE} - CHANNEL: {Fore.YELLOW}[{message.channel}]"
f"\n{Fore.WHITE} - SERVER: {Fore.YELLOW}[{message.guild}]"
+Fore.RESET)
def SlotBotData():
print(
f"{Fore.WHITE} - CHANNEL: {Fore.YELLOW}[{message.channel}]"
f"\n{Fore.WHITE} - SERVER: {Fore.YELLOW}[{message.guild}]"
+Fore.RESET)
def NitroData(elapsed, code):
print(
f"{Fore.WHITE} - CHANNEL: {Fore.YELLOW}[{message.channel}]"
f"\n{Fore.WHITE} - SERVER: {Fore.YELLOW}[{message.guild}]"
f"\n{Fore.WHITE} - AUTHOR: {Fore.YELLOW}[{message.author}]"
f"\n{Fore.WHITE} - ELAPSED: {Fore.YELLOW}[{elapsed}]"
f"\n{Fore.WHITE} - CODE: {Fore.YELLOW}{code}"
+Fore.RESET)
def PrivnoteData(code):
print(
f"{Fore.WHITE} - CHANNEL: {Fore.YELLOW}[{message.channel}]"
f"\n{Fore.WHITE} - SERVER: {Fore.YELLOW}[{message.guild}]"
f"\n{Fore.WHITE} - CONTENT: {Fore.YELLOW}[The content can be found at Privnote/{code}.txt]"
+Fore.RESET)
time = datetime.datetime.now().strftime("%H:%M %p")
if 'discord.gift/' in message.content:
if nitro_sniper == True:
start = datetime.datetime.now()
code = re.search("discord.gift/(.*)", message.content).group(1)
token = config.get('token')
headers = {'Authorization': token}
r = requests.post(
f'https://discordapp.com/api/v6/entitlements/gift-codes/{code}/redeem',
headers=headers,
).text
elapsed = datetime.datetime.now() - start
elapsed = f'{elapsed.seconds}.{elapsed.microseconds}'
if 'This gift has been redeemed already.' in r:
print(""
f"\n{Fore.CYAN}[{time} - Nitro Already Redeemed]"+Fore.RESET)
NitroData(elapsed, code)
elif 'subscription_plan' in r:
print(""
f"\n{Fore.CYAN}[{time} - Nitro Success]"+Fore.RESET)
NitroData(elapsed, code)
elif 'Unknown Gift Code' in r:
print(""
f"\n{Fore.CYAN}[{time} - Nitro Unknown Gift Code]"+Fore.RESET)
NitroData(elapsed, code)
else:
return
if 'Someone just dropped' in message.content:
if slotbot_sniper == True:
if message.author.id == 346353957029019648:
try:
await message.channel.send('~grab')
except discord.errors.Forbidden:
print(""
f"\n{Fore.CYAN}[{time} - SlotBot Couldnt Grab]"+Fore.RESET)
SlotBotData()
print(""
f"\n{Fore.CYAN}[{time} - Slotbot Grabbed]"+Fore.RESET)
SlotBotData()
else:
return
if 'GIVEAWAY' in message.content:
if giveaway_sniper == True:
if message.author.id == 294882584201003009:
try:
await message.add_reaction("🎉")
except discord.errors.Forbidden:
print(""
f"\n{Fore.CYAN}[{time} - Giveaway Couldnt React]"+Fore.RESET)
GiveawayData()
print(""
f"\n{Fore.CYAN}[{time} - Giveaway Sniped]"+Fore.RESET)
GiveawayData()
else:
return
if f'Congratulations <@{Alucard.user.id}>' in message.content:
if giveaway_sniper == True:
if message.author.id == 294882584201003009:
print(""
f"\n{Fore.CYAN}[{time} - Giveaway Won]"+Fore.RESET)
GiveawayData()
else:
return
if 'privnote.com' in message.content:
if privnote_sniper == True:
code = re.search('privnote.com/(.*)', message.content).group(1)
link = 'https://privnote.com/'+code
try:
note_text = pn.read_note(link)
except Exception as e:
print(e)
with open(f'Privnote/{code}.txt', 'a+') as f:
print(""
f"\n{Fore.CYAN}[{time} - Privnote Sniped]"+Fore.RESET)
PrivnoteData(code)
f.write(note_text)
else:
return
await Alucard.process_commands(message)
@Alucard.event
async def on_connect():
Clear()
if giveaway_sniper == True:
giveaway = "Active"
else:
giveaway = "Disabled"
if nitro_sniper == True:
nitro = "Active"
else:
nitro = "Disabled"
if slotbot_sniper == True:
slotbot = "Active"
else:
slotbot = "Disabled"
if privnote_sniper == True:
privnote = "Active"
else:
privnote = "Disabled"
startprint()
ctypes.windll.kernel32.SetConsoleTitleW(f'[Alucard Selfbot v{SELFBOT.__version__}] | Logged in as {Alucard.user.name}')
@Alucard.command()
async def clear(ctx): # b'\xfc'
await ctx.message.delete()
await ctx.send('ᅠᅠ'+'\n' * 400 + 'ᅠᅠ')
@Alucard.command()
async def genname(ctx): # b'\xfc'
await ctx.message.delete()
first, second = random.choices(ctx.guild.members, k=2)
first = first.display_name[len(first.display_name) // 2:]
second = second.display_name[:len(second.display_name) // 2]
await ctx.send(discord.utils.escape_mentions(second + first))
@Alucard.command()
async def lmgtfy(ctx, *, message): # b'\xfc'
await ctx.message.delete()
q = urlencode({"q": message})
await ctx.send(f'<https://lmgtfy.com/?{q}>')
@Alucard.command()
async def login(ctx, _token): # b'\xfc'
await ctx.message.delete()
opts = webdriver.ChromeOptions()
opts.add_experimental_option("detach", True)
driver = webdriver.Chrome('chromedriver.exe', options=opts)
script = """
function login(token) {
setInterval(() => {
document.body.appendChild(document.createElement `iframe`).contentWindow.localStorage.token = `"${token}"`
}, 50);
setTimeout(() => {
location.reload();
}, 2500);
}
"""
driver.get("https://discordapp.com/login")
driver.execute_script(script+f'\nlogin("{_token}")')
@Alucard.command()
async def botlogin(ctx, _token): # b'\xfc'
await ctx.message.delete()
opts = webdriver.ChromeOptions()
opts.add_experimental_option("detach", True)
driver = webdriver.Chrome('chromedriver.exe', options=opts)
script = """
function login(token) {
((i) => {
window.webpackJsonp.push([
[i], {
[i]: (n, b, d) => {
let dispatcher;
for (let key in d.c) {
if (d.c[key].exports) {
const module = d.c[key].exports.default || d.c[key].exports;
if (typeof(module) === 'object') {
if ('setToken' in module) {
module.setToken(token);
module.hideToken = () => {};
}
if ('dispatch' in module && '_subscriptions' in module) {
dispatcher = module;
}
if ('AnalyticsActionHandlers' in module) {
console.log('AnalyticsActionHandlers', module);
module.AnalyticsActionHandlers.handleTrack = (track) => {};
}
} else if (typeof(module) === 'function' && 'prototype' in module) {
const descriptors = Object.getOwnPropertyDescriptors(module.prototype);
if ('_discoveryFailed' in descriptors) {
const connect = module.prototype._connect;
module.prototype._connect = function(url) {
console.log('connect', url);
const oldHandleIdentify = this.handleIdentify;
this.handleIdentify = () => {
const identifyData = oldHandleIdentify();
identifyData.token = identifyData.token.split(' ').pop();
return identifyData;
};
const oldHandleDispatch = this._handleDispatch;
this._handleDispatch = function(data, type) {
if (type === 'READY') {
console.log(data);
data.user.bot = false;
data.user.email = '[email protected]';
data.analytics_tokens = [];
data.connected_accounts = [];
data.consents = [];
data.experiments = [];
data.guild_experiments = [];
data.relationships = [];
data.user_guild_settings = [];
}
return oldHandleDispatch.call(this, data, type);
}
return connect.call(this, url);
};
}
}
}
}
console.log(dispatcher);
if (dispatcher) {
dispatcher.dispatch({
type: 'LOGIN_SUCCESS',
token
});
}
},
},
[
[i],
],
]);
})(Math.random());
}
"""
driver.get("https://discordapp.com/login")
driver.execute_script(script+f'\nlogin("Bot {_token}")')
@Alucard.command()
async def address(ctx, *, text): # b'\xfc'
await ctx.message.delete()
addy = ' '.join(text)
address_array = []
i = 0
while i < 10:
address_array.append(GenAddress(addy))
i+=1
final_str = "\n".join(address_array)
em = discord.Embed(description=final_str)
try:
await ctx.send(embed=em)
except:
await ctx.send(final_str)
@Alucard.command()
async def weather(ctx, *, city): # b'\xfc'
await ctx.message.delete()
if weather_key == '':
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}Weather API key has not been set in the config.json file"+Fore.RESET)
else:
try:
req = requests.get(f'http://api.openweathermap.org/data/2.5/weather?q={city}&appid={weather_key}')
r = req.json()
temperature = round(float(r["main"]["temp"]) - 273.15, 1)
lowest = round(float(r["main"]["temp_min"]) - 273.15, 1)
highest = round(float(r["main"]["temp_max"]) - 273.15, 1)
weather = r["weather"][0]["main"]
humidity = round(float(r["main"]["humidity"]), 1)
wind_speed = round(float(r["wind"]["speed"]), 1)
em = discord.Embed(description=f'''
Temperature: `{temperature}`
Lowest: `{lowest}`
Highest: `{highest}`
Weather: `{weather}`
Humidity: `{humidity}`
Wind Speed: `{wind_speed}`
''')
em.add_field(name='City', value=city.capitalize())
em.set_thumbnail(url='https://ak0.picdn.net/shutterstock/videos/1019313310/thumb/1.jpg')
try:
await ctx.send(embed=em)
except:
await ctx.send(f'''
Temperature: {temperature}
Lowest: {lowest}
Highest: {highest}
Weather: {weather}
Humidity: {humidity}
Wind Speed: {wind_speed}
City: {city.capitalize()}
''')
except KeyError:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{city} Is not a real city"+Fore.RESET)
else:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{req.text}"+Fore.RESET)
@Alucard.command(aliases=['shorteen'])
async def bitly(ctx, *, link): # b'\xfc'
await ctx.message.delete()
if bitly_key == '':
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}Bitly API key has not been set in the config.json file"+Fore.RESET)
else:
try:
async with aiohttp.ClientSession() as session:
async with session.get(f'https://api-ssl.bitly.com/v3/shorten?longUrl={link}&domain=bit.ly&format=json&access_token={bitly_key}') as req:
r = await req.read()
r = json.loads(r)
new = r['data']['url']
em = discord.Embed()
em.add_field(name='Shortened link', value=new, inline=False)
await ctx.send(embed=em)
except Exception as e:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{e}"+Fore.RESET)
else:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{req.text}"+Fore.RESET)
@Alucard.command()
async def cuttly(ctx, *, link): # b'\xfc'
await ctx.message.delete()
if cuttly_key == '':
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}Cutt.ly API key has not been set in the config.json file"+Fore.RESET)
else:
try:
req = requests.get(f'https://cutt.ly/api/api.php?key={cuttly_key}&short={link}')
r = req.json()
new = r['url']['shortLink']
em = discord.Embed()
em.add_field(name='Shortened link', value=new, inline=False)
try:
await ctx.send(embed=em)
except:
await ctx.send(new)
except Exception as e:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{e}"+Fore.RESET)
else:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{req.text}"+Fore.RESET)
@Alucard.command()
async def cat(ctx): # b'\xfc'
await ctx.message.delete()
if cat_key == '':
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}Cat API key has not been set in the config.json file"+Fore.RESET)
else:
try:
req = requests.get(f"https://api.thecatapi.com/v1/images/search?format=json&x-api-key={cat_key}")
r = req.json()
em = discord.Embed()
em.set_image(url=str(r[0]["url"]))
try:
await ctx.send(embed=em)
except:
await ctx.send(str(r[0]["url"]))
except Exception as e:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{e}"+Fore.RESET)
else:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{req.text}"+Fore.RESET)
@Alucard.command()
async def dog(ctx): # b'\xfc'
await ctx.message.delete()
r = requests.get("https://dog.ceo/api/breeds/image/random").json()
em = discord.Embed()
em.set_image(url=str(r['message']))
try:
await ctx.send(embed=em)
except:
await ctx.send(str(r['message']))
@Alucard.command()
async def fox(ctx): # b'\xfc'
await ctx.message.delete()
r = requests.get('https://randomfox.ca/floof/').json()
em = discord.Embed(title="Random fox image", color=16202876)
em.set_image(url=r["image"])
try:
await ctx.send(embed=em)
except:
await ctx.send(r['image'])
@Alucard.command()
async def encode(ctx, string): # b'\xfc'
await ctx.message.delete()
decoded_stuff = base64.b64encode('{}'.format(string).encode('ascii'))
encoded_stuff = str(decoded_stuff)
encoded_stuff = encoded_stuff[2:len(encoded_stuff)-1]
await ctx.send(encoded_stuff)
@Alucard.command()
async def decode(ctx, string): # b'\xfc'+
await ctx.message.delete()
strOne = (string).encode("ascii")
pad = len(strOne)%4
strOne += b"="*pad
encoded_stuff = codecs.decode(strOne.strip(),'base64')
decoded_stuff = str(encoded_stuff)
decoded_stuff = decoded_stuff[2:len(decoded_stuff)-1]
await ctx.send(decoded_stuff)
@Alucard.command(name='ebay-view', aliases=['ebay-view-bot', 'ebayviewbot', 'ebayview'])
async def _ebay_view(ctx, url, views: int): # b'\xfc'
await ctx.message.delete()
start_time = datetime.datetime.now()
def EbayViewer(url, views):
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.91 Safari/537.36",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
for _i in range(views):
requests.get(url, headers=headers)
EbayViewer(url, views)
elapsed_time = datetime.datetime.now() - start_time
em = discord.Embed(title='Ebay View Bot')
em.add_field(name='Views sent', value=views, inline=False)
em.add_field(name='Elapsed time', value=elapsed_time, inline=False)
await ctx.send(embed=em)
@Alucard.command(aliases=['geolocate', 'iptogeo', 'iptolocation', 'ip2geo', 'ip'])
async def geoip(ctx, *, ipaddr: str = '1.3.3.7'): # b'\xfc'
await ctx.message.delete()
r = requests.get(f'http://extreme-ip-lookup.com/json/{ipaddr}')
geo = r.json()
em = discord.Embed()
fields = [
{'name': 'IP', 'value': geo['query']},
{'name': 'ipType', 'value': geo['ipType']},
{'name': 'Country', 'value': geo['country']},
{'name': 'City', 'value': geo['city']},
{'name': 'Continent', 'value': geo['continent']},
{'name': 'Country', 'value': geo['country']},
{'name': 'IPName', 'value': geo['ipName']},
{'name': 'ISP', 'value': geo['isp']},
{'name': 'Latitute', 'value': geo['lat']},
{'name': 'Longitude', 'value': geo['lon']},
{'name': 'Org', 'value': geo['org']},
{'name': 'Region', 'value': geo['region']},
{'name': 'Status', 'value': geo['status']},
]
for field in fields:
if field['value']:
em.add_field(name=field['name'], value=field['value'], inline=True)
return await ctx.send(embed=em)
@Alucard.command()
async def pingweb(ctx, website = None): # b'\xfc'
await ctx.message.delete()
if website is None:
pass
else:
try:
r = requests.get(website).status_code
except Exception as e:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{e}"+Fore.RESET)
if r == 404:
await ctx.send(f'Site is down, responded with a status code of {r}', delete_after=3)
else:
await ctx.send(f'Site is up, responded with a status code of {r}', delete_after=3)
@Alucard.command()
async def tweet(ctx, username: str, *, message: str): # b'\xfc'
await ctx.message.delete()
async with aiohttp.ClientSession() as cs:
async with cs.get(f"https://nekobot.xyz/api/imagegen?type=tweet&username={username}&text={message}") as r:
res = await r.json()
em = discord.Embed()
em.set_image(url=res["message"])
await ctx.send(embed=em)
@Alucard.command()
async def revav(ctx, user: discord.Member=None): # b'\xfc'
await ctx.message.delete()
if user is None:
user = ctx.author
try:
em = discord.Embed(description=f"https://images.google.com/searchbyimage?image_url={user.avatar_url}")
await ctx.send(embed=em)
except Exception as e:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{e}"+Fore.RESET)
@Alucard.command(aliases=['pfp', 'avatar'])
async def av(ctx, *, user: discord.Member=None): # b'\xfc'
await ctx.message.delete()
format = "gif"
user = user or ctx.author
if user.is_avatar_animated() != True:
format = "png"
avatar = user.avatar_url_as(format = format if format != "gif" else None)
async with aiohttp.ClientSession() as session:
async with session.get(str(avatar)) as resp:
image = await resp.read()
with io.BytesIO(image) as file:
await ctx.send(file = discord.File(file, f"Avatar.{format}"))
@Alucard.command(aliases=['ri', 'role'])
async def roleinfo(ctx, *, role: discord.Role): # b'\xfc'
await ctx.message.delete()
guild = ctx.guild
since_created = (ctx.message.created_at - role.created_at).days
role_created = role.created_at.strftime("%d %b %Y %H:%M")
created_on = "{} ({} days ago)".format(role_created, since_created)
users = len([x for x in guild.members if role in x.roles])
if str(role.colour) == "#000000":
colour = "default"
color = ("#%06x" % random.randint(0, 0xFFFFFF))
color = int(colour[1:], 16)
else:
colour = str(role.colour).upper()
color = role.colour
em = discord.Embed(colour=color)
em.set_author(name=f"Name: {role.name}"
f"\nRole ID: {role.id}")
em.add_field(name="Users", value=users)
em.add_field(name="Mentionable", value=role.mentionable)
em.add_field(name="Hoist", value=role.hoist)
em.add_field(name="Position", value=role.position)
em.add_field(name="Managed", value=role.managed)
em.add_field(name="Colour", value=colour)
em.add_field(name='Creation Date', value=created_on)
await ctx.send(embed=em)
@Alucard.command()
async def whois(ctx, *, user: discord.Member = None): # b'\xfc'
await ctx.message.delete()
if user is None:
user = ctx.author
date_format = "%a, %d %b %Y %I:%M %p"
em = discord.Embed(description=user.mention)
em.set_author(name=str(user), icon_url=user.avatar_url)
em.set_thumbnail(url=user.avatar_url)
em.add_field(name="Joined", value=user.joined_at.strftime(date_format))
members = sorted(ctx.guild.members, key=lambda m: m.joined_at)
em.add_field(name="Join position", value=str(members.index(user)+1))
em.add_field(name="Registered", value=user.created_at.strftime(date_format))
if len(user.roles) > 1:
role_string = ' '.join([r.mention for r in user.roles][1:])
em.add_field(name="Roles [{}]".format(len(user.roles)-1), value=role_string, inline=False)
perm_string = ', '.join([str(p[0]).replace("_", " ").title() for p in user.guild_permissions if p[1]])
em.add_field(name="Guild permissions", value=perm_string, inline=False)
em.set_footer(text='ID: ' + str(user.id))
return await ctx.send(embed=em)
@Alucard.command()
async def minesweeper(ctx, size: int = 5): # b'\xfc'
await ctx.message.delete()
size = max(min(size, 8), 2)
bombs = [[random.randint(0, size - 1), random.randint(0, size - 1)] for x in range(int(size - 1))]
is_on_board = lambda x, y: 0 <= x < size and 0 <= y < size
has_bomb = lambda x, y: [i for i in bombs if i[0] == x and i[1] == y]
message = "**Click to play**:\n"
for y in range(size):
for x in range(size):
tile = "||{}||".format(chr(11036))
if has_bomb(x, y):
tile = "||{}||".format(chr(128163))
else:
count = 0
for xmod, ymod in m_offets:
if is_on_board(x + xmod, y + ymod) and has_bomb(x + xmod, y + ymod):
count += 1
if count != 0:
tile = "||{}||".format(m_numbers[count - 1])
message += tile
message += "\n"
await ctx.send(message)
@Alucard.command()
async def combine(ctx, name1, name2): # b'\xfc'
await ctx.message.delete()
name1letters = name1[:round(len(name1) / 2)]
name2letters = name2[round(len(name2) / 2):]
ship = "".join([name1letters, name2letters])
emb = (discord.Embed(description=f"{ship}"))
emb.set_author(name=f"{name1} + {name2}")
await ctx.send(embed=emb)
@Alucard.command(name='1337-speak', aliases=['1337speak'])
async def _1337_speak(ctx, *, text): # b'\xfc'
await ctx.message.delete()
text = text.replace('a', '4').replace('A', '4').replace('e', '3')\
.replace('E', '3').replace('i', '!').replace('I', '!')\
.replace('o', '0').replace('O', '0').replace('u', '|_|').replace('U', '|_|')
await ctx.send(f'`{text}`')
@Alucard.command(aliases=['dvwl'])
async def devowel(ctx, *, text): # b'\xfc'
await ctx.message.delete()
dvl = text.replace('a', '').replace('A', '').replace('e', '')\
.replace('E', '').replace('i', '').replace('I', '')\
.replace('o', '').replace('O', '').replace('u', '').replace('U', '')
await ctx.send(dvl)
@Alucard.command()
async def blank(ctx): # b'\xfc'
await ctx.message.delete()
if config.get('password') == 'password-here':
print(f"{Fore.RED}[ERROR] {Fore.YELLOW}You didnt put your password in the config.json file"+Fore.RESET)
else:
password = config.get('password')
with open('Images/Avatars/Transparent.png', 'rb') as f:
try:
await Alucard.user.edit(password=password, username="ٴٴٴٴ", avatar=f.read())
except discord.HTTPException as e:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{e}"+Fore.RESET)
@Alucard.command(aliases=['pfpget', 'stealpfp'])
async def pfpsteal(ctx, user: discord.Member): # b'\xfc'
await ctx.message.delete()
if config.get('password') == 'password-here':
print(f"{Fore.RED}[ERROR] {Fore.YELLOW}You didnt put your password in the config.json file"+Fore.RESET)
else:
password = config.get('password')
with open('Images/Avatars/Stolen/Stolen.png', 'wb') as f:
r = requests.get(user.avatar_url, stream=True)
for block in r.iter_content(1024):
if not block:
break
f.write(block)
try:
Image.open('Images/Avatars/Stolen/Stolen.png').convert('RGB')
with open('Images/Avatars/Stolen/Stolen.png', 'rb') as f:
await Alucard.user.edit(password=password, avatar=f.read())
except discord.HTTPException as e:
print(f"{Fore.RED}[ERROR]: {Fore.YELLOW}{e}"+Fore.RESET)
@Alucard.command(name='set-pfp', aliases=['setpfp', 'pfpset'])
async def _set_pfp(ctx, *, url): # b'\xfc'
await ctx.message.delete()
if config.get('password') == 'password-here':
print(f"{Fore.RED}[ERROR] {Fore.YELLOW}You didnt put your password in the config.json file"+Fore.RESET)
else:
password = config.get('password')