Skip to content

Commit

Permalink
Update AmeyBot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenSourceTuxedoCat authored Mar 12, 2023
1 parent c10b857 commit 21263da
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions AmeyBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def countTimer():
else:
return True
def ameyMainJsonFetch():
global welcomeFont, BOT_SOUND, API_SERVICE_NAME, API_VERSION, API_SCOPES, API_KEYS, CLIENT_FILES, CLIENT_LINKS, ameyBotEmojiMain, ameyBotEmojiReplace
global welcomeFont, BOT_SOUND, API_SERVICE_NAME, API_VERSION, API_SCOPES, API_KEYS, CLIENT_FILES, ameyBotEmojiMain, ameyBotEmojiReplace
API_CONFIG_FILE = urlopen("https://github.com/Amey-Gurjar/AmeyBotAssets/raw/main/JSON/internalAmeyBotSetting.json")
API_CONFIG = json.load(API_CONFIG_FILE)
# BOT STYLE
Expand All @@ -75,8 +75,6 @@ def ameyMainJsonFetch():
API_KEYS = API_CONFIG["AMEYBOTAPI"]["botApiKeys"]
# CLIENT FILES
CLIENT_FILES = API_CONFIG["AMEYBOTAPI"]["botClientJsonFiles"]
# CLIENT LINKS
CLIENT_LINKS = API_CONFIG["AMEYBOTAPI"]["CLIENT_LINKS"]
return None

# def botAuthenticator():
Expand Down Expand Up @@ -121,8 +119,7 @@ def authChat():
# Get credentials and create an API client
flow = InstalledAppFlow.from_client_secrets_file(
CLIENT_SECRET_FILE, API_SCOPES)
webbrowser.open(CLIENT_LINK)
credentials = flow.run_console()
credentials = flow.run_local_server()
os.remove(jsonFileName)
global youtubeMain
global youtubeBan
Expand Down Expand Up @@ -488,18 +485,16 @@ def chatBot():
def apiInp():
try:
def checkapiversion():
global CLIENT_SECRET_FILE, CLIENT_LINK, API_KEY
global CLIENT_SECRET_FILE, API_KEY
inputApiVersion = str(input(Fore.BLUE+"Enter The Api Version (1 To 4, Default 1): "+Fore.RESET))
if inputApiVersion == "":
inputApiVersion = "1"
inputApiVersion = int(inputApiVersion)
if inputApiVersion <= len(API_KEYS):
CLIENT_FILES_MAIN = list(CLIENT_FILES.values())
API_KEYS_MAIN = list(API_KEYS.values())
CLIENT_LINKS_MAIN = list(CLIENT_LINKS.values())
CLIENT_SECRET_FILE = urltojson(CLIENT_FILES_MAIN[inputApiVersion-1], f"CLIENTJSON{inputApiVersion}.json")
API_KEY = API_KEYS_MAIN[inputApiVersion-1]
CLIENT_LINK = CLIENT_LINKS_MAIN[inputApiVersion-1]
authChat()
else:
printError("Invalid API! Please Try Again.")
Expand Down Expand Up @@ -560,4 +555,4 @@ def mainGui():
printNor(version)
configValidate()
except Exception as e:
print(e)
print(e)

0 comments on commit 21263da

Please sign in to comment.