import sqlite3
from colorama import Fore
db = sqlite3.connect('Account.db')
sql = db.cursor()
global Twonum
def main():
sql.execute("""CREATE TABLE IF NOT EXISTS Account (
phone TEXT,
pass TEXT,
wallet TEXT,
apiid TEXT,
apihash TEXT
)""")
db.commit()
def main():
global Phone
Phone = input(Fore.YELLOW+'Ваш номер телефона:')
Pass = input('Ваш пароль: ')
Wallet = 'MyWallet'
Apiid = 'xxxxxx'
Apihash = 'xxxxxx'
sql.execute(f"SELECT phone FROM Account WHERE phone = '{Phone}'")
if sql.fetchone() is None:
sql.execute(f"INSERT INTO Account VALUES (?,?,?,?,?)",(Phone, Pass, Wallet, Apiid, Apihash))
db.commit()
Correcting()
else:
print(Fore.RED+"Аккаунт с таким номером уже имеется")
def Correcting():
Correct = input(Fore.LIGHTGREEN_EX+'Если все ОК то нажмите Enter, если по новой то напиши del: ')
if Correct == '':
print(Fore.LIGHTGREEN_EX+'Успешно добавлено!')
#too_many_acc()
for acc_count in sql.execute("SELECT Count(*) FROM Account"):
print(Fore.LIGHTBLUE_EX,acc_count)
for acc_data in sql.execute("SELECT phone, pass FROM Account"):
print(Fore.BLUE,f"{acc_data}")
elif Correct == 'del' or 'Del' or 'DEL' or 'dEL':
sql.execute(f"DELETE FROM Account WHERE phone = '{Phone}'")
print(Fore.LIGHTGREEN_EX+'Успешно удалено! Добавьте аккаунт заново:')
main()
def too_many_acc():
print(Fore.RED+'Добавление множества аккаунтов включено!')
main()
__main__ = '__main__'
if __main__ == '__main__':
main()