File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 23
23
"""
24
24
25
25
import argparse
26
+ import getpass
26
27
import os
27
28
import pathlib
28
29
import platform
@@ -227,6 +228,51 @@ def generate_bot() -> ...:
227
228
with open (comp_dir / "general.py" , "w" ) as fp :
228
229
fp .write (COMPONENT )
229
230
231
+ client_id = None
232
+ client_sec = None
233
+ config = bool_check (validate_input ("Would you like to create a config? (y/N): " , bool_validate ))
234
+
235
+ if config :
236
+
237
+ while True :
238
+
239
+ client_id = validate_input ("Please enter your Client-ID: " )
240
+ cid_reenter = validate_input ("Please re-enter your Client-ID: " )
241
+
242
+ if client_id != cid_reenter :
243
+ print ("Client-ID does not match, please try again..." , end = "\n \n " )
244
+ continue
245
+
246
+ break
247
+
248
+ while True :
249
+ client_sec = getpass .getpass ("Please enter your Client-Secret: " )
250
+ csec_reenter = getpass .getpass ("Please re-enter your Client-Secret: " )
251
+
252
+ if client_sec != csec_reenter :
253
+ print ("Client-Secret does not match, please try again..." , end = "\n \n " )
254
+ continue
255
+
256
+ break
257
+
258
+ config_data = f"""[secrets]\n client_id = \" { client_id } \" \n client_secret = \" { client_sec } \" """
259
+ with open ("config.toml" , "w" ) as fp :
260
+ fp .write (config_data )
261
+
262
+ if client_id and client_sec :
263
+ while True :
264
+ owner_name = validate_input ("Please enter the Twitch username of the owner of this Bot (E.g. chillymosh): " )
265
+ bot_name = validate_input ("Please enter the Twitch username of the Bot Account (E.g. chillybot): " )
266
+ names = f"Owner Name: '{ owner_name } '\n Bot Name: '{ bot_name } '"
267
+
268
+ correct = bool_check (validate_input (f"Is this information correct? (y/N)\n \n { names } \n " , bool_validate ))
269
+ if not correct :
270
+ continue
271
+
272
+ break
273
+
274
+
275
+
230
276
# TODO: .env
231
277
# TODO: client details
232
278
# TODO: fetch owner/bot IDs
You can’t perform that action at this time.
0 commit comments