-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ghost.py
8201 lines (7188 loc) · 438 KB
/
Ghost.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
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# Copyright (C) 2021 Ben Tettmar
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import os
from re import T
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
printSpaces = " "
if os.name == "nt":
os.system("cls")
# os.system("mode 100,25")
os.system("title Ghost")
if os.name == "posix":
os.system("clear")
print(" ")
print(f"{printSpaces}Loading Ghost...")
print(" ")
import sys
import subprocess
import logging
if not os.path.exists('logs/'):
os.makedirs('logs/')
print(printSpaces+"Made logs folder.")
open("logs/info.log", "w").write(" ")
print(printSpaces+"Resetting info log.")
open("logs/warning.log", "w").write(" ")
print(printSpaces+"Resetting warning log.")
open("logs/error.log", "w").write(" ")
print(printSpaces+"Resetting error log.")
open("logs/critical.log", "w").write(" ")
print(printSpaces+"Resetting critical log.")
print(" ")
logging.basicConfig(filename="logs/info.log", level=logging.INFO)
logging.basicConfig(filename="logs/warning.log", level=logging.WARNING)
logging.basicConfig(filename="logs/error.log", level=logging.ERROR)
logging.basicConfig(filename="logs/critical.log", level=logging.CRITICAL)
try:
# pythonVersion = float(str(sys.version_info[0])+"."+str(sys.version_info[1]))
# if pythonVersion < 3.8:
# input("You're not using a supported Python version.")
# exit()
# else:
# print("You're using a supported python version, " + str(pythonVersion))
def install(package):
os.system(f"{sys.executable} -m pip install {package}")
def uninstall(package):
os.system(f"{sys.executable} -m pip uninstall {package}")
if "discord.py" in sys.modules:
uninstall("discord.py")
if "discordselfbot" in sys.modules:
uninstall("discordselfbot")
try:
import discord
except ModuleNotFoundError:
install("discord.py-self")
try:
import pyPrivnote as pn
except ModuleNotFoundError:
install("pyPrivnote")
try:
import names
except ModuleNotFoundError:
install("names")
try:
import simplejson
except ModuleNotFoundError:
install("simplejson")
try:
import aiohttp
except ModuleNotFoundError:
install("aiohttp")
try:
from colour import Color
except ModuleNotFoundError:
install("colour")
try:
from termcolor import colored
except ModuleNotFoundError:
install("termcolor")
try:
from faker import Faker
except ModuleNotFoundError:
install("Faker")
if os.name == "nt":
try:
import plyer
except ModuleNotFoundError:
install("plyer")
try:
from sty import fg, bg, ef, rs, Style, RgbFg
except ModuleNotFoundError:
install("sty==1.0.0rc0")
try:
import discord_rpc
except ModuleNotFoundError:
install("discord-rpc.py")
try:
import requests
except ModuleNotFoundError:
install("requests")
try:
import uwuify
except ModuleNotFoundError:
install("uwuify")
try:
import numpy as np
except ModuleNotFoundError:
install("numpy")
try:
import discum
except ModuleNotFoundError:
install("discum")
try:
from discord_webhook import DiscordWebhook, DiscordEmbed
except ModuleNotFoundError:
install("discord-webhook")
try:
from random_user_agent.user_agent import UserAgent
from random_user_agent.params import SoftwareName, OperatingSystem
except ModuleNotFoundError:
install("random_user_agent")
try:
import GPUtil
except ModuleNotFoundError:
install("gputil")
try:
import psutil
except ModuleNotFoundError:
install("psutil")
try:
import PIL
except ModuleNotFoundError:
install("pillow")
try:
import pygame
except ModuleNotFoundError:
install("pygame")
# if os.name == "posix":
# if str(subprocess.check_output(["apt-cache", "policy", "libportaudio2"])).split("\\n")[1][2:].split(": ")[1] == "(none)":
# os.system("sudo apt-get install libportaudio2")
try:
import sounddevice
except ModuleNotFoundError:
install("sounddevice")
try:
import discord_emoji
except ModuleNotFoundError:
install("discord-emoji")
if sys.platform == "darwin":
try:
import pync
except ModuleNotFoundError:
install("pync")
if os.name == "nt":
try:
import wmi
except ModuleNotFoundError:
install("WMI")
import wmi
if os.name == "nt":
import plyer
try:
import tkinter
except:
pass
if sys.platform == "darwin":
import pync
import discord_emoji
import threading
import pygame
import PIL
from random_user_agent.user_agent import UserAgent
from random_user_agent.params import SoftwareName, OperatingSystem
from discord_webhook import DiscordWebhook, DiscordEmbed
import discum
if os.name == "nt":
import winshell
import uwuify
import getpass
import mimetypes
import discord_rpc
from sty import fg, bg, ef, rs, Style, RgbFg
import discord
import json
import pyPrivnote as pn
import random
import asyncio
import requests
import aiohttp
import names
import string
import simplejson
import base64
import math
import time
import urllib
import urllib.request
import codecs
import platform
import psutil
import re
import ctypes
import ctypes.util
import GPUtil
from urllib.request import Request, urlopen
from colour import Color
from discord.ext import commands
from discord.utils import get
from termcolor import colored, cprint
from os.path import dirname, basename, isfile, join
from datetime import datetime, timedelta
import numpy as np
from faker import Faker
def update_config():
configJson = json.load(open("config.json"))
configFile = open("config.json", "r").read()
if ("riskmode" not in configFile):
print(f"{printSpaces}Adding risk mode to config.")
configJson["riskmode"] = bool(False)
if ("load_on_startup" not in configFile):
print(f"{printSpaces}Adding load on startup to config.")
configJson["load_on_startup"] = bool(False)
if ("giveaway_join_delay" not in configFile):
print(f"{printSpaces}Adding giveaway join delay to config.")
configJson["giveaway_join_delay"] = 15
if ("giveaway_sniper_ui" not in configFile):
print(printSpaces+"Adding giveaway sniper ui to config.")
configJson["giveaway_sniper_ui"] = False
if ("snipers" not in configFile):
configJson["snipers"] = {}
print(printSpaces+"Adding nitro sniper to config.")
configJson["snipers"]["nitro"] = bool(True)
print(printSpaces+"Adding privnote sniper to config.")
configJson["snipers"]["privnote"] = bool(True)
print(printSpaces+"Adding giveaway sniper to config.")
configJson["snipers"]["giveaway"] = bool(True)
if ("webhooks" not in configFile):
configJson["webhooks"] = {}
print(printSpaces+"Adding nitro webhook to config.")
configJson["webhooks"]["nitro"] = ""
print(printSpaces+"Adding privnote webhook to config.")
configJson["webhooks"]["privnote"] = ""
print(printSpaces+"Adding giveaway webhook to config.")
configJson["webhooks"]["giveaway"] = ""
if ("motd" not in configFile):
configJson["motd"] = {}
configJson["motd"]["custom"] = bool(False)
print(printSpaces+"Adding custom motd option to config.")
configJson["motd"]["custom_text"] = "Super Cool Custom MOTD"
print(printSpaces+"Adding custom motd text to config.")
if ("selfbot_detect" in configFile):
configJson.pop("selfbot_detect")
print(printSpaces+"Removing selfbot detect from config.")
if ("ghostping_detect" in configFile):
configJson.pop("ghostping_detect")
print(printSpaces+"Removing ghostping detect from config.")
if ("ghostping" not in configJson["webhooks"]):
configJson["webhooks"]["ghostping"] = ""
print(printSpaces+"Adding ghostping webhook to config.")
if ("friendsupdate" not in configJson["webhooks"]):
configJson["webhooks"]["friendsupdate"] = ""
print(printSpaces+"Adding friends update webhook to config.")
if ("dmtyping" not in configJson["webhooks"]):
configJson["webhooks"]["dmtyping"] = ""
print(printSpaces+"Adding DM typing webhook to config.")
if ("guildleave" not in configJson["webhooks"]):
configJson["webhooks"]["guildleave"] = ""
print(printSpaces+"Adding guild leave webhook to config.")
if ("selfbot" not in configJson["webhooks"]):
configJson["webhooks"]["selfbot"] = ""
print(printSpaces+"Adding selfbot webhook to config.")
if ("tickets" not in configJson["webhooks"]):
configJson["webhooks"]["tickets"] = ""
print(printSpaces+"Adding tickets webhook to config.")
if ("sounds" not in configFile):
configJson["sounds"] = bool(True)
print(printSpaces+"Adding sounds toggle to config.")
if ("detections" not in configFile):
configJson["detections"] = {}
configJson["detections"]["selfbot"] = bool(True)
print(printSpaces+"Adding selfbot detection to config.")
configJson["detections"]["ghostping"] = bool(True)
print(printSpaces+"Adding ghostping detection to config.")
configJson["detections"]["bans"] = bool(True)
print(printSpaces+"Adding ban detection to config.")
if ("deletedmessages" not in configJson["detections"]):
configJson["detections"]["deletedmessages"] = bool(False)
print(printSpaces+"Adding deleted messages detection to config.")
if ("webhookmodification" not in configJson["detections"]):
configJson["detections"]["webhookmodification"] = bool(True)
print(printSpaces+"Adding webhook modification detection to config.")
if ("friendsupdate" not in configJson["detections"]):
configJson["detections"]["friendsupdate"] = bool(True)
print(printSpaces+"Adding friends update detection to config.")
if ("dmtyping" not in configJson["detections"]):
configJson["detections"]["dmtyping"] = bool(True)
print(printSpaces+"Adding DM typing detection to config.")
if ("guildleave" not in configJson["detections"]):
configJson["detections"]["guildleave"] = bool(True)
print(printSpaces+"Adding guild leave detection to config.")
if ("embed_mode" not in configFile):
configJson["embed_mode"] = bool(False)
print(printSpaces+"Adding embed mode to config.")
if ("ignored_servers" not in configFile):
configJson["ignored_servers"] = {}
configJson["ignored_servers"]["nitro"] = []
print(printSpaces+"Adding nitro ignored servers to config.")
configJson["ignored_servers"]["privnote"] = []
print(printSpaces+"Adding privnote ignored servers to config.")
configJson["ignored_servers"]["giveaways"] = []
print(printSpaces+"Adding giveaways ignored servers to config.")
configJson["ignored_servers"]["ghostpings"] = []
print(printSpaces+"Adding ghostpings ignored servers to config.")
configJson["ignored_servers"]["selfbots"] = []
print(printSpaces+"Adding selfbots ignored servers to config.")
configJson["ignored_servers"]["bans"] = []
print(printSpaces+"Adding bans ignored servers to config.")
configJson["ignored_servers"]["deletedmessages"] = []
print(printSpaces+"Adding deletedmessages ignored servers to config.")
if ("webhookmodifications" not in configJson["ignored_servers"]):
configJson["ignored_servers"]["webhookmodifications"] = []
print(printSpaces+"Adding webhook modification ignored servers to config.")
if ("tickets" not in configJson["snipers"]):
configJson["snipers"]["tickets"] = bool(True)
print(printSpaces+"Adding ticket sniper to config.")
if ("tickets" not in configJson["ignored_servers"]):
configJson["ignored_servers"]["tickets"] = []
print(printSpaces+"Adding tickets ignored servers to config.")
if ("guildleave" not in configJson["ignored_servers"]):
configJson["ignored_servers"]["guildleave"] = []
print(printSpaces+"Adding guild leave ignored servers to config.")
if ("api_keys" not in configFile):
print(printSpaces+"Adding api keys to config.")
configJson["api_keys"] = {}
configJson["api_keys"]["tenor"] = ""
if ("alexflipnote" not in configJson["api_keys"]):
print(printSpaces+"Adding alexflipnote to api keys.")
configJson["api_keys"]["alexflipnote"] = ""
if ("afkmode" not in configFile):
print(printSpaces+"Adding afkmode to config.")
configJson["afkmode"] = {}
configJson["afkmode"]["enabled"] = False
configJson["afkmode"]["replymessage"] = "im currently afk :/"
json.dump(configJson, open("config.json", "w"), sort_keys=False, indent=4)
configJson = json.load(open("config.json"))
configFile = open("config.json", "r").read()
if ("load_on_startup" in configFile):
configJson.pop("load_on_startup")
print(printSpaces+"Removing load on startup from config.")
json.dump(configJson, open("config.json", "w"), sort_keys=False, indent=4)
if not os.path.exists('pytoexe/'): os.makedirs('pytoexe/');
if not os.path.exists('privnote-saves/'): os.makedirs('privnote-saves/');
if not os.path.exists('scripts/'): os.makedirs('scripts/');
if not os.path.exists('data/'): os.makedirs('data/');
if not os.path.exists('themes/'): os.makedirs('themes/');
if not os.path.exists('sounds/'): os.makedirs('sounds/');
if not os.path.isfile("data/icon.png"): open("data/icon.png", "wb").write(requests.get("https://raw.githubusercontent.com/GhostSelfbot/Branding/main/ghost.png", allow_redirects=True).content)
# if not os.path.isfile('icon.ico'): open('icon.ico', 'wb').write(requests.get('https://ghost.cool/favicon.ico', allow_redirects=True).content);
# if not os.path.isfile('sounds/connected.mp3'): open('sounds/connected.mp3', 'wb').write(requests.get('https://ghost.cool/assets/sounds/connected.mp3', allow_redirects=True).content);
# if not os.path.isfile('sounds/error.mp3'): open('sounds/error.mp3', 'wb').write(requests.get('https://ghost.cool/assets/sounds/error.mp3', allow_redirects=True).content);
# if not os.path.isfile('sounds/notification.mp3'): open('sounds/notification.mp3', 'wb').write(requests.get('https://ghost.cool/assets/sounds/notification.mp3', allow_redirects=True).content);
# if not os.path.isfile('sounds/success.mp3'): open('sounds/success.mp3', 'wb').write(requests.get('https://ghost.cool/assets/sounds/success.mp3', allow_redirects=True).content);
# if not os.path.isfile('sounds/giveaway-win.mp3'): open('sounds/giveaway-win.mp3', 'wb').write(requests.get('https://ghost.cool/assets/sounds/giveaway-win.mp3', allow_redirects=True).content);
# if not os.path.exists('trump-tweets/'): os.makedirs('trump-tweets/');
# if not os.path.exists('trump-tweets/assets'): os.makedirs('trump-tweets/assets');
# if not os.path.isfile('trump-tweets/assets/bg.png'):
# dtrumpbg = 'https://bennyware.xyz/files/dtrumptweetbg.png'
# dtrumpbg_r = requests.get(dtrumpbg, allow_redirects=True)
# open('trump-tweets/assets/bg.png', 'wb').write(dtrumpbg_r.content)
# if not os.path.isfile('trump-tweets/assets/roboto.ttf'):
# font = 'https://bennyware.xyz/files/roboto.ttf'
# font_r = requests.get(font, allow_redirects=True)
# open('trump-tweets/assets/roboto.ttf', 'wb').write(font_r.content)
# open('data/icon.png', 'wb').write(requests.get('http://ghost.cool/assets/icon.png', allow_redirects=True).content)
if not os.path.isfile('config.json'):
f = open('config.json', "w")
f.write("""
{
"token": "",
"prefix": ".",
"delete_timeout": 15,
"theme": "Ghost"
}
""")
f.close()
if not os.path.isfile('giveawaybots.json'):
f = codecs.open('giveawaybots.json', "w", encoding="UTF-8")
f.write("""
{
"294882584201003009": "🎉",
"396464677032427530": "🎉",
"720351927581278219": "🎉",
"582537632991543307": "🎉"
}
""")
f.close()
if not os.path.isfile('customcommands.json'):
f = open('customcommands.json', "w")
f.write("""
{
"cmd1": "this is cmd1",
"cmd2": "this is cmd2"
}
""")
f.close()
if not os.path.isfile('richpresence.json'):
f = open('richpresence.json', 'w')
f.write("""
{
"enabled": true,
"client_id": 807369019744059403,
"details": "Using Ghost selfbot...",
"state": "",
"large_image_key": "icon",
"large_image_text": "ghost.cool"
}
""")
f.close()
if os.path.isfile("richpresence.json"):
jsonFile = json.load(open("richpresence.json"))
if jsonFile["client_id"] == 807369019744059403:
jsonFile["client_id"] = 877223591828136006
if jsonFile["details"] == "Using Ghost selfbot...":
jsonFile["details"] = "Using Ghost..."
if "small_image_key" not in jsonFile:
jsonFile["small_image_key"] = "small"
if "small_image_text" not in jsonFile:
jsonFile["small_image_text"] = "best sb for £2"
json.dump(jsonFile, open("richpresence.json", "w"), sort_keys=False, indent=4)
if not os.path.isfile('themes/Ghost.json'):
f = open('themes/Ghost.json', "w")
f.write("""
{
"embedtitle": "Ghost",
"embedcolour": "#3B79FF",
"consolecolour": "#3B79FF",
"embedfooter": "ghost.cool",
"embedfooterimage": "https://ghost.cool/assets/icon.gif",
"globalemoji": ":blue_heart:",
"embedimage": "https://ghost.cool/assets/icon.gif"
}
""")
f.close()
if not os.path.isfile('data/personal-pins.json'):
f = open('data/personal-pins.json', "w")
f.write("{}")
f.close()
if not os.path.isfile('data/tokens.txt'):
f = open('data/tokens.txt', "w")
f.close()
if not os.path.isfile('data/rickroll.txt'):
f = open('data/rickroll.txt', "w")
f.write("""We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy
I just wanna tell you how I'm feeling
Gotta make you understand
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
We've known each other for so long
Your heart's been aching but you're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it
And if you ask me how I'm feeling
Don't tell me you're too blind to see
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
Never gonna give, never gonna give
(Give you up)
(Ooh) Never gonna give, never gonna give
(Give you up)
We've known each other for so long
Your heart's been aching but you're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it
I just wanna tell you how I'm feeling
Gotta make you understand
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt...""")
f.close()
if not os.path.isfile('scripts/example.py'):
f = open('scripts/example.py', "w")
f.write('''
@Ghost.command(name="example", description="Example custom script.", usage="example")
async def example(Ghost):
exampleEmbed = discord.Embed(
title="Example Embed",
description="""
An example embed to display what you can do in scripts.
Check `scripts/example.py` to see the code!
** **
Ghost scripts are all created in python using discord.py so you can use any feature from discord.py.
""",
color=__embedcolour__
)
exampleEmbed.add_field(name="Variables", value="""
**\_\_embedtitle\_\_** : Theme's embed title.
**\_\_embedcolour\_\_** : Theme's embed colour.
**\_\_embedfooter\_\_** : Theme's embed footer.
**\_\_embedimage\_\_** : Theme's embed image url.
**\_\_embedfooterimage\_\_** : Theme's embed footer image url.
**\_\_embedemoji\_\_** : Theme's global emoji.
**\_\_deletetimeout\_\_** : Config delete timeout (seconds).
""")
exampleEmbed.set_thumbnail(url=__embedimage__)
exampleEmbed.set_footer(text=__embedfooter__, icon_url=__embedfooterimage__)
await Ghost.send("Hello World!", embed=exampleEmbed)
''')
f.close()
if json.load(open("config.json"))["token"] == "":
os.system("cls")
os.system("clear")
print("")
print("Please input your Discord token below.".center(os.get_terminal_size().columns))
print("")
token = input()
config = json.load(open("config.json"))
config["token"] = (token)
json.dump(config, open('config.json', 'w'), sort_keys=False, indent=4)
ccmd_file = open('customcommands.json')
ccmd = json.load(ccmd_file)
def updateTheme(theme):
themeJson = json.load(open(f"themes/{theme}"))
if "consolecolour" not in themeJson:
themeJson["consolecolour"] = "#3B79FF"
if "consolemode" not in themeJson:
themeJson["consolemode"] = "new"
if "embedlargeimage" not in themeJson:
themeJson["embedlargeimage"] = ""
json.dump(themeJson, open(f"themes/{theme}", "w"), sort_keys=False, indent=4)
for theme in os.listdir("themes"):
if theme.endswith(".json"):
updateTheme(theme)
update_config()
CONFIG = json.load(open("config.json"))
GIVEAWAYBOTS = json.load(codecs.open("giveawaybots.json", encoding="UTF-8"))
__token__ = CONFIG["token"]
__prefix__ = CONFIG["prefix"]
# __loadonstartup__ = CONFIG["load_on_startup"]
__deletetimeout__ = CONFIG["delete_timeout"]
__theme__ = CONFIG["theme"]
__sounds__ = CONFIG["sounds"]
__riskmode__ = CONFIG["riskmode"]
__nitrosniper__ = CONFIG["snipers"]["nitro"]
__privnotesniper__ = CONFIG["snipers"]["privnote"]
__giveawaysniper__ = CONFIG["snipers"]["giveaway"]
__giveawaysniperui__ = CONFIG["giveaway_sniper_ui"]
__ticketsniper__ = CONFIG["snipers"]["tickets"]
__nitrowebhook__ = CONFIG["webhooks"]["nitro"]
__privnotewebhook__ = CONFIG["webhooks"]["privnote"]
__giveawaywebhook__ = CONFIG["webhooks"]["giveaway"]
__ghostpingwebhook__ = CONFIG["webhooks"]["ghostping"]
__friendsupdatewebhook__ = CONFIG["webhooks"]["friendsupdate"]
__dmtypingwebhook__ = CONFIG["webhooks"]["dmtyping"]
__guildleavewebhook__ = CONFIG["webhooks"]["guildleave"]
__selfbotwebhook__ = CONFIG["webhooks"]["selfbot"]
__ticketswebhook__ = CONFIG["webhooks"]["tickets"]
__giveawayjoindelay__ = CONFIG["giveaway_join_delay"]
__custommotd__ = CONFIG["motd"]["custom"]
__custommotdtext__ = CONFIG["motd"]["custom_text"]
__selfbotdetect__ = CONFIG["detections"]["selfbot"]
__ghostpingdetect__ = CONFIG["detections"]["ghostping"]
__bandetect__ = CONFIG["detections"]["bans"]
__deletedmessagesdetect__ = CONFIG["detections"]["deletedmessages"]
__webhookmodificationdetect__ = CONFIG["detections"]["webhookmodification"]
__friendsupdatedetect__ = CONFIG["detections"]["friendsupdate"]
__dmtypingdetect__ = CONFIG["detections"]["dmtyping"]
__guildleavedetect__ = CONFIG["detections"]["guildleave"]
THEME = json.load(open(f"themes/{__theme__}.json"))
__embedtitle__ = THEME["embedtitle"]
__embedcolour__ = int(THEME["embedcolour"].replace('#', '0x'), 0)
__embedcolourraw__ = THEME["embedcolour"]
__embedfooter__ = THEME["embedfooter"]
__embedemoji__ = THEME["globalemoji"]
__embedimage__ = THEME["embedimage"]
__embedlargeimage__ = THEME["embedlargeimage"]
__embedfooterimage__ = THEME["embedfooterimage"]
__embedmode__ = CONFIG["embed_mode"]
__consolemode__ = THEME["consolemode"]
__ignoredservers__ = CONFIG["ignored_servers"]
__consolecolour__ = THEME["consolecolour"]
__ghostloaded__ = False
__guildleaveignoredservers__ = CONFIG["ignored_servers"]["guildleave"]
nsfwTypes = ["boobs", "ass", "hentai", "porngif", "pussy", "tits", "tittydrop", "tittypop", "titty", "femboy"]
now = datetime.now()
fake = Faker()
def getCurrentTime():
return datetime.now().strftime("%H:%M:%S")
def print_important(message):
print(f"{printSpaces}{fg.cGrey}[{getCurrentTime()}] {fg.cPurple}[IMPORTANT] {fg.cWhite}{message}")
def print_info(message):
print(f"{printSpaces}{fg.cGrey}[{getCurrentTime()}] {fg.cYellow}[INFORMATION] {fg.cWhite}{message}")
def print_cmd(command):
print(f"{printSpaces}{fg.cGrey}[{getCurrentTime()}] {fg.consoleColour}[COMMAND] {fg.cWhite}{command}")
def print_sharecmd(author, command):
print(f"{printSpaces}{fg.cGrey}[{getCurrentTime()}] {fg.consoleColour}[SHARE COMMAND] {fg.cWhite}({author}) {command}")
def print_error(error):
print(f"{printSpaces}{fg.cGrey}[{getCurrentTime()}] {fg.cRed}[ERROR] {fg.cWhite}{error}")
def print_detect(message):
print(f"{printSpaces}{fg.cGrey}[{getCurrentTime()}] {fg.cPink}[DETECT] {fg.cWhite}{message}")
def print_sniper(message):
print(f"{printSpaces}{fg.cGrey}[{getCurrentTime()}] {fg.cOrange}[SNIPER] {fg.cWhite}{message}")
def print_sniper_info(firstmessage, secondmessage):
spaces = ""
# for i in range(len(f"[{getCurrentTime()}]")):
# spaces += " "
print(f"{printSpaces}{spaces} {fg.cYellow}{firstmessage}: {fg.cGrey}{secondmessage}")
def is_me(m):
return m.author == Ghost.user
def restart_bot():
python = sys.executable
os.execl(python, python, * sys.argv)
def close_bot():
os.system("taskkill /IM Ghost.exe")
def is_windows():
return os.name == "nt"
def is_linux():
return os.name == "posix"
def GetUUID():
if is_windows():
cmd = 'wmic csproduct get uuid'
uuid = str(subprocess.check_output(cmd))
pos1 = uuid.find("\\n")+2
uuid = uuid[pos1:-15]
elif is_linux():
uuid = str(subprocess.Popen(["dmidecode", "-s", "system-uuid"], stdout=subprocess.PIPE).communicate()[0]).replace("b'", "").replace("\\n'", "")
return uuid
# Found: https://stackoverflow.com/a/64676639
def hex_to_rgb(hex_string):
r_hex = hex_string[1:3]
g_hex = hex_string[3:5]
b_hex = hex_string[5:7]
red = int(r_hex, 16)
green = int(g_hex, 16)
blue = int(b_hex, 16)
return red, green, blue
def get_nsfw(type):
types = nsfwTypes
if type not in types:
return "Invalid type."
else:
for type2 in types:
if type == type2:
request = requests.get(f"https://www.reddit.com/r/{type2}/random.json", headers={'User-agent': get_random_user_agent()}).json()
url = request[0]["data"]["children"][0]["data"]["url"]
if "redgifs" in str(url):
url = request[0]["data"]["children"][0]["data"]["preview"]["reddit_video_preview"]["fallback_url"]
return url
def get_nsfw_custom_type(type):
request = requests.get(f"https://www.reddit.com/r/{type}/random.json", headers={'User-agent': get_random_user_agent()}).json()
url = request[0]["data"]["children"][0]["data"]["url"]
if "redgifs" in str(url):
url = request[0]["data"]["children"][0]["data"]["preview"]["reddit_video_preview"]["fallback_url"]
return url
def send_notification(title, message, duration):
if sys.platform == "win32":
plyer.notification.notify(
title=title,
message=message,
app_name="Ghost",
app_icon="icon.ico",
timeout=duration,
toast=True
)
elif sys.platform == "darwin":
pync.notify(message, title=title)
def claim_nitro(code, userToken):
URL = f'https://discordapp.com/api/v6/entitlements/gift-codes/{code}/redeem'
result = requests.post(URL, headers={'Authorization': userToken}).text
if 'nitro' in result:
return "Valid Code"
else:
return "Invalid Code"
def read_privnote(url):
content = pn.read_note(link=url)
return content
def get_random_user_agent():
userAgents = ["Mozilla/5.0 (Windows NT 6.2;en-US) AppleWebKit/537.32.36 (KHTML, live Gecko) Chrome/56.0.3075.83 Safari/537.32", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.1", "Mozilla/5.0 (Windows NT 8.0; WOW64) AppleWebKit/536.24 (KHTML, like Gecko) Chrome/32.0.2019.89 Safari/536.24", "Mozilla/5.0 (Windows NT 5.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.41 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3058.0 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3258.0 Safari/537.36", "Mozilla/5.0 (Windows NT 5.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36", "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2599.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.35 (KHTML, like Gecko) Chrome/27.0.1453.0 Safari/537.35", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.139 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/6.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.0.9757 Safari/537.36", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.1", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3258.0 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/6.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.1", "Mozilla/5.0 (Windows NT 5.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2151.2 Safari/537.36", "Mozilla/5.0 (Windows NT 5.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1204.0 Safari/537.1", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/67.0.3387.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.0.9757 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3359.181 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.81 Safari/537.36", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3251.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/538 (KHTML, like Gecko) Chrome/36 Safari/538", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.18 Safari/535.1", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Chrome/5.0.355.0 Safari/533.3", "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.4 Safari/532.0", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.35 (KHTML, like Gecko) Chrome/27.0.1453.0 Safari/537.35", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3359.181 Safari/537.36", "Mozilla/5.0 (Windows NT 10.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36", "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3057.0 Safari/537.36", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.14 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.14", "Mozilla/5.0 (Windows NT 6.4; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36 TC2", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3058.0 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3258.0 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2531.0 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.81 Safari/537.36", "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36,gzip(gfe)", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2264.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.29 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.150 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.45 Safari/537.36", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.14 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.14", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2714.0 Safari/537.36", "24.0.1284.0.0 (Windows NT 5.1) AppleWebKit/534.0 (KHTML, like Gecko) Chrome/24.0.1284.0.3.742.3 Safari/534.3", "Mozilla/5.0 (X11; Ubuntu; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1864.6 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Chrome/36.0.1985.125 CrossBrowser/36.0.1985.138 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Avast/70.0.917.102", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1615.0 Safari/537.36", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.14 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.14", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/6.0 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3608.0 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.81 Safari/537.36", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3251.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/54.2.133 Chrome/48.2.2564.133 Safari/537.36", "24.0.1284.0.0 (Windows NT 5.1) AppleWebKit/534.0 (KHTML, like Gecko) Chrome/24.0.1284.0.3.742.3 Safari/534.3", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/54.2.133 Chrome/48.2.2564.133 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/54.2.133 Chrome/48.2.2564.133 Safari/537.36", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.18 Safari/535.1", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2427.7 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.61 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Chrome/36.0.1985.125 CrossBrowser/36.0.1985.138 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.45 Safari/537.36", "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/530.6 (KHTML, like Gecko) Chrome/2.0.174.0 Safari/530.6", "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.29 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.104 Safari/537.36", "24.0.1284.0.0 (Windows NT 5.1) AppleWebKit/534.0 (KHTML, like Gecko) Chrome/24.0.1284.0.3.742.3 Safari/534.3", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko; Google Web Preview) Chrome/27.0.1453 Safari/537.36,gzip(gfe)", "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.29 Safari/537.36", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.45 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.45", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.150 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.102 Safari/537.36", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2419.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Chrome/36.0.1985.125 CrossBrowser/36.0.1985.138 Safari/537.36", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1204.0 Safari/537.1", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2700.0 Safari/537.36#", "Mozilla/5.0 (Windows NT 10.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.16 (KHTML, like Gecko) Chrome/5.0.335.0 Safari/533.16", "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.68 Safari/537.36", "Mozilla/5.0 (Windows; U; Windows 95) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.43 Safari/535.1", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2700.0 Safari/537.36#", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.114 Safari/537.36", "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/530.6 (KHTML, like Gecko) Chrome/2.0.174.0 Safari/530.6", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/538 (KHTML, like Gecko) Chrome/36 Safari/538", "Mozilla/5.0 (Windows; U; Windows 95) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.43 Safari/535.1", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.18 Safari/535.1", "Mozilla/5.0 (X11; Linux x86_64; 6.1) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/17.0.1410.63 Safari/537.31", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2583.0 Safari/537.36", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2151.2 Safari/537.36", "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.18 Safari/535.1", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/536.36 (KHTML, like Gecko) Chrome/67.2.3.4 Safari/536.36", "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.0 Safari/530.5", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.69 Safari/537.36", "Mozilla/5.0 (Windows NT 10.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.81 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Safari/537.36 EdgA/41.0.0.1662", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.1"]
userAgent = random.choice(userAgents)
return userAgent
def avatarUrl(id, avatar):
url = ""
if not str(avatar).startswith("http"):
if str(avatar).startswith("a_"):
url = f"https://cdn.discordapp.com/avatars/{id}/{avatar}.gif?size=1024"
else:
url = f"https://cdn.discordapp.com/avatars/{id}/{avatar}.png?size=1024"
return url
else:
return avatar
def iconUrl(id, icon):
url = ""
if str(icon).startswith("a_"):
url = f"https://cdn.discordapp.com/avatars/{id}/{icon}.gif?size=1024"
else:
url = f"https://cdn.discordapp.com/avatars/{id}/{icon}.png?size=1024"
return icon
def resource_path(relative_path):
# try:
# base_path = sys._MEIPASS
# except Exception:
# base_path = os.path.abspath(".")
# return os.path.join(base_path, relative_path)
return relative_path
def get_friends(token):
request = requests.get("https://discord.com/api/users/@me/relationships", headers={"Authorization": token})
json = request.json()
friends = []
for item in json:
if item["type"] == 1:
friends.append(item["user"])
return friends
class Config():
def __init__(self):
self.json = json.load(open("config.json"))
self.token = self.json["token"]
self.prefix = self.json["prefix"]
self.deleteTimeout = self.json["delete_timeout"]
self.theme = self.json["theme"]
self.giveawayJoinDelay = self.json["giveaway_join_delay"]
def getConfig():
return json.load(open("config.json"))
def saveConfig(data):
return json.dump(data, open("config.json", "w"), indent=4, sort_keys=False)
def changeToken(newToken):
global __token__
__token__ = newToken
cfg = Config.getConfig()
cfg["token"] = newToken
Config.saveConfig(cfg)
def changePrefix(newPrefix):
global __prefix__
__prefix__ = newPrefix
Ghost.command_prefix = newPrefix
cfg = Config.getConfig()
cfg["prefix"] = newPrefix
Config.saveConfig(cfg)
def changeDeleteTimeout(newDeleteTimeout):
global __deletetimeout__
newDeleteTimeout = int(newDeleteTimeout)
__deletetimeout__ = newDeleteTimeout
cfg = Config.getConfig()
cfg["delete_timeout"] = newDeleteTimeout
Config.saveConfig(cfg)
def changeGiveawayJoinDelay(newJoinDelay):
global __giveawayjoindelay__
newJoinDelay = int(newJoinDelay)
__giveawayjoindelay__ = newJoinDelay
cfg = Config.getConfig()
cfg["giveaway_join_delay"] = newJoinDelay
Config.saveConfig(cfg)
def changeTheme(newTheme):
global __embedtitle__, __embedcolour__, __embedfooter__, __embedemoji__, __embedimage__, __embedfooterimage__, __embedcolourraw__, __theme__, __embedlargeimage__
__embedtitle__ = json.load(open(f"themes/{newTheme}.json"))["embedtitle"]
__embedcolour__ = int(json.load(open(f"themes/{newTheme}.json"))["embedcolour"].replace('#', '0x'), 0)
__embedcolourraw__ = json.load(open(f"themes/{newTheme}.json"))["embedcolour"]
__embedfooter__ = json.load(open(f"themes/{newTheme}.json"))["embedfooter"]
__embedemoji__ = json.load(open(f"themes/{newTheme}.json"))["globalemoji"]
__embedimage__ = json.load(open(f"themes/{newTheme}.json"))["embedimage"]
__embedfooterimage__ = json.load(open(f"themes/{newTheme}.json"))["embedfooterimage"]
__embedlargeimage__ = json.load(open(f"themes/{newTheme}.json"))["embedlargeimage"]
__theme__ = newTheme
cfg = Config.getConfig()
cfg["theme"] = newTheme
Config.saveConfig(cfg)
ccolourred, ccolourgreen, ccolourblue = hex_to_rgb(__consolecolour__)
fg.consoleColour = Style(RgbFg(ccolourred, ccolourgreen, ccolourblue))
fg.cRed = Style(RgbFg(255, 81, 69))
fg.cOrange = Style(RgbFg(255, 165, 69))
fg.cYellow = Style(RgbFg(255, 255, 69))
fg.cGreen = Style(RgbFg(35, 222, 57))
fg.cBlue = Style(RgbFg(69, 119, 255))
fg.cPurple = Style(RgbFg(177, 69, 255))
fg.cPink = Style(RgbFg(255, 69, 212))
fg.cGrey = Style(RgbFg(207, 207, 207))
fg.cBrown = Style(RgbFg(199, 100, 58))
fg.cBlack = Style(RgbFg(0, 0, 0))
fg.cWhite = Style(RgbFg(255, 255, 255))
if is_windows():
os.system("cls")
os.system(f"title Ghost")
elif is_linux():
os.system("clear")
if requests.get("https://discord.com/api/users/@me/settings", headers={"Authorization": __token__}).status_code == 200:
status = requests.get("https://discord.com/api/users/@me/settings", headers={"Authorization": __token__}).json()["status"]
else:
status = "online"
Ghost = commands.Bot(command_prefix=__prefix__, self_bot=True, status=discord.Status.try_value(status))
Ghost.remove_command('help')
Ghost.launch_time = datetime.utcnow()
botStartTime = time.time()
giveawayBots = []
for index in GIVEAWAYBOTS:
giveawayBots.append(int(index))
version = "2.3.7"
cycleStatusText = ""
cycleStatus = False
discordServer = "discord.gg/reKgzfRrpt"
uwuifyEnabled = False
channelBlankChar = ""
spammingMessages = False
rickRollEnabled = False
nukingToken = False
consoleMode = __consolemode__
consoleModes = ["new", "new2", "new3", "new4", "bear", "old", "react", "rise", "nighty", "rainbow"]
scriptsList = []
afkMode = CONFIG["afkmode"]["enabled"]
def include(filename):
global scriptsList
if os.path.exists(filename):
scriptsList.append(filename)
exec(codecs.open(filename, encoding="utf-8").read(), globals(), locals())
# hideText = "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"
if not __custommotd__:
motd = "Developed by Benny | Discontinued October 2021"
else:
motd = __custommotdtext__
@Ghost.event
async def on_connect():
if str(sounddevice.query_devices()) != "":
pygame.mixer.init()
width = os.get_terminal_size().columns
if is_windows():
os.system("cls")
os.system(f"title Ghost [{version}] [{Ghost.user}]")