Skip to content

Commit 62b93b9

Browse files
author
6nz
authored
Important fix/improvements
Linux fix + compatibility + small improvements
1 parent c6590d1 commit 62b93b9

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

main.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import sys
2-
31
from keyauth import api
2+
3+
import sys
44
import time
55
import os
66
import hashlib
@@ -12,7 +12,12 @@
1212

1313
# watch setup video if you need help https://www.youtube.com/watch?v=L2eAQOmuUiA
1414

15-
os.system("cls & title Python Example")
15+
if os.name == 'nt':
16+
os.system('cls & title Python Example')
17+
else:
18+
os.system('clear')
19+
sys.stdout.write("\x1b]0;Python Example\x07")
20+
1621
print("Initializing")
1722

1823

@@ -131,14 +136,13 @@ def answer():
131136
# * Send chat message
132137
# keyauthapp.chatSend("MESSAGE", "CHANNEL")
133138

139+
# * Add Application Information to Title
140+
# os.system(f"cls & title KeyAuth Python Example - Total Users: {keyauthapp.app_data.numUsers} - Online Users: {keyauthapp.app_data.onlineUsers} - Total Keys: {keyauthapp.app_data.numKeys}")
134141

135142
# * Auto-Login Example (THIS IS JUST AN EXAMPLE --> YOU WILL HAVE TO EDIT THE CODE PROBABLY)
136143
# 1. Checking and Reading JSON
137144

138-
# * Add Application Information to Title
139-
# os.system(f"cls & title KeyAuth Python Example - Total Users: {keyauthapp.app_data.numUsers} - Online Users: {keyauthapp.app_data.onlineUsers} - Total Keys: {keyauthapp.app_data.numKeys}")
140-
141-
#### Note: Remove the ''' on line 140 and 199
145+
#### Note: Remove the ''' on line 147 and 222
142146

143147
'''try:
144148
if os.path.isfile('auth.json'): #Checking if the auth file exist
@@ -251,4 +255,4 @@ def answer():
251255
print(f"Current Session Validation Status: {keyauthapp.check()}")
252256
print("Exiting in 10 secs....")
253257
sleep(10)
254-
os._exit(1)
258+
os._exit(1)

0 commit comments

Comments
 (0)