-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
126 lines (120 loc) · 5.91 KB
/
setup.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
import time
import os
def setup():
print("\n")
token = input("Please enter your Bot token\n")
prefix = input("Please enter your Bot prefix\n")
member = input("Please enter your Member role ID\n")
mod = input("Please enter your Moderator role ID\n")
admin = input("Please enter your Admin role ID\n")
guild = input("Please enter your Guild ID\n")
log_channel = input("Please enter the channel ID for logs. (If you do not want to enable logs please press ENTER)\n")
print("\n\n")
print("Confirm with these values.")
time.sleep(2)
print(f"Token: {token}")
print(f"Prefix: {prefix}")
print(f"Member Role ID: {member}")
print(f"Moderator Role ID: {mod}")
print(f"Admin Role ID: {admin}")
print(f"Guild ID: {guild}")
print(f"Log Channel ID: {log_channel}")
info_recheck = input("Is that information correct? [Y/N]\n")
if info_recheck == "Y" or info_recheck == "y":
print("Please wait while the bot is being setup.")
with open(".env", "w") as env:
env.write(f"TOKEN={token}" + "\n")
env.write(f"PREFIX={prefix}" + "\n")
env.write(f"MEMBER_ROLE={member}" + "\n")
env.write(f"MODERATOR_ROLE={mod}" + "\n")
env.write(f"ADMIN_ROLE={admin}" + "\n")
env.write(f"GUILD_ID={guild}" + "\n")
env.write(f"LOG_CHANNEL={log_channel}")
if log_channel == "":
os.chdir("cogs")
os.remove("logs.py")
os.chdir("..")
print("File logs.py removed.")
time.sleep(5)
exit()
else:
print("Setup complete.")
time.sleep(5)
exit()
if info_recheck == "N" or info_recheck == "n":
print("Please restart the setup.")
exit()
def tutorial():
print("Welcome to the BeepBoopBot Tutorial! We will explain how to get information needed for the setup here.")
print("\nToken: Go to https://discord.com/developers/applications and click on your Application\nthen click on the 'Bot' in left sidebar, click on 'Copy' under your Bot's name\n")
print("Prefix: Enter the prefix you want for your bot\n")
print("Member Role: Go to the Discord App, Right click on your Member role and click 'Copy ID'.\n")
print("Moderator Role: Go to the Discord App, Right click on your Moderator role and click 'Copy ID'.\n")
print("Admin Role: Go to the Discord App, Right click on your Admin role and click 'Copy ID'.\n")
print("Guild ID: Go to the Discord App, Right click on your Guild and click 'Copy ID'.\n")
print("Log Channel ID: Go to the Discord App, Right click on your Log Channel and click 'Copy ID'.\n")
setup_after_tutorial = input("Do you want to go back to the setup? [Y/N]\n")
if setup_after_tutorial == "Y" or setup_after_tutorial == "y":
main()
else:
exit()
def setup_and_tutorial():
print("\n")
token = input("Please enter your Bot token\nSteps: Go to https://discord.com/developers/applications and click on your Application\nthen click on the 'Bot' in left sidebar, click on 'Copy' under your Bot's name\n")
prefix = input("Please enter your Bot prefix\nSteps: Enter the prefix you want for your bot\n")
member = input("Please enter your Member ID\nSteps: Go to the Discord App, Right click on your Member role and click 'Copy ID'.\n")
mod = input("Please enter your Moderator ID\nSteps: Go to the Discord App, Right click on your Moderator role and click 'Copy ID'.\n")
admin = input("Please enter your Admin ID\nSteps: Go to the Discord App, Right click on your Admin role and click 'Copy ID'.\n")
guild = input("Please enter your Guild ID\nSteps: Go to the Discord App, Right click on your Guild and click 'Copy ID'.\n")
log_channel = input("Please enter the channel ID for logs. (Press ENTER to disable logs)\nSteps: Go to the Discord App, Right click on your Log Channel and click 'Copy ID'.\n")
print("\n\n")
print("Confirm with these values.")
time.sleep(2)
print(f"Token: {token}")
print(f"Prefix: {prefix}")
print(f"Member Role ID: {member}")
print(f"Moderator Role ID: {mod}")
print(f"Admin Role ID: {admin}")
print(f"Guild ID: {guild}")
print(f"Log Channel ID: {log_channel}")
info_recheck = input("Is that information correct? [Y/N]\n")
if info_recheck == "Y" or info_recheck == "y":
print("Please wait while the bot is being setup.")
with open(".env", "w") as env:
env.write(f"TOKEN={token}" + "\n")
env.write(f"PREFIX={prefix}" + "\n")
env.write(f"MEMBER_ROLE={member}" + "\n")
env.write(f"MODERATOR_ROLE={mod}" + "\n")
env.write(f"ADMIN_ROLE={admin}" + "\n")
env.write(f"GUILD_ID={guild}" + "\n")
env.write(f"LOG_CHANNEL={log_channel}")
if log_channel == "":
os.chdir("cogs")
os.remove("logs.py")
os.chdir("..")
print("File logs.py removed.")
time.sleep(5)
exit()
else:
print("Setup complete.")
time.sleep(5)
exit()
if info_recheck == "N" or info_recheck == "n":
print("Please restart the setup.")
exit()
def main():
print("Welcome to the BeepBoopBot setup.")
main = input("Please chose from the following options:\n[1] Tutorial\n[2] Setup\n[3] Both\n[4] Exit\n")
if main == "1":
tutorial()
if main == "2":
setup()
if main == "3":
setup_and_tutorial()
if main == "4":
exit()
else:
print("Please enter a valid option.")
main()
if __name__ == "__main__":
main()