-
Notifications
You must be signed in to change notification settings - Fork 48
/
LinkGen.py
110 lines (96 loc) · 5.77 KB
/
LinkGen.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
# Imports
try:
import json, os, platform, time, discord
except Exception:
if platform.system() == "Windows": os.system("cls")
else: os.system("clear")
print("LinkGen uses Pycord, Try to remove discord.py when installed")
time.sleep(3)
if platform.system() == "Windows": os.system("cls")
else: os.system("clear")
print("Pycord not found - Installing...\n")
os.system("pip install py-cord==2.0.0b4")
os._exit(0)
client = discord.Bot()
# Check if correctly setup
if os.path.exists("accounts"): pass
else: os.mkdir("accounts")
if platform.system() == "Windows": os.system("cls")
else: os.system("clear")
try: json.loads(open("config.json", "r").read())
except Exception: print("[ERROR] Config File missing")
try:json.loads(open("config.json", "r").read())["token"]
except Exception: print("[ERROR] Discord Token not set")
try:json.loads(open("config.json", "r").read())["guild_id"]
except Exception: print("[ERROR] Guild ID not set")
try:json.loads(open("config.json", "r").read())["log_channel"]
except Exception: print("[ERROR] Log Channel not set")
# When bot is logged in
@client.event
async def on_ready():
print(f"Logged in as: {client.user.name}")
print(f"Using guild: {client.guilds[0].name}")
print("LinkGen Ready", "\n")
await client.change_presence(activity=discord.Game(name="LinkGen V2.0"))
try: client.guilds[0].get_role(int(json.loads(open("config.json", "r").read())["gen_role"]))
except Exception: print("[ERROR] Gen Role not set")
try: client.guilds[0].get_channel(int(json.loads(open("config.json", "r").read())["gen_channel"]))
except Exception: print("[ERROR] Gen Channel not set")
services = ["nordvpn", "hulu", "expressvpn", "nitro", "creditcard", "spotify", "netflix", "disney", "minecraft"]
for service in services:
if os.path.exists(f"accounts/{service}.txt"): pass
else:
open(f"accounts/{service}.txt", "a").write(f"Paste {service} accounts here")
print(f"[WARNING] No Accounts found for {service} - Creating file...")
# Generate Command
@client.slash_command(name="generate", guild_ids=[json.loads(open(&qu