Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranjal-SB authored Jun 21, 2024
1 parent da4bb72 commit 9eeb2c2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions makeconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import configparser
import os

#user inputs
config = configparser.ConfigParser()
config_file = 'config.ini'

def get_config():
if not os.path.exists(config_file):
token = input("Enter your Discord bot token: ")
rping = input("Enter the role ID for rare ping: ")
regping = input("Enter the role ID for regional ping: ")
config['DEFAULT'] = {'TOKEN': token, 'RPING': rping, 'REGPING': regping}

with open(config_file, 'w') as configfile:
config.write(configfile)
else:
config.read(config_file)

get_config()

TKN = config['DEFAULT']['TOKEN']
rping = int(config['DEFAULT']['RPING'])
regping = int(config['DEFAULT']['REGPING'])

0 comments on commit 9eeb2c2

Please sign in to comment.