-
Notifications
You must be signed in to change notification settings - Fork 20
/
change_lic.py
40 lines (31 loc) · 1022 Bytes
/
change_lic.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Developed by: MasterkinG32
# Date: 2024
# Github: https://github.com/masterking32
# Telegram: https://t.me/MasterCryptoFarmBot
import sqlite3
import mcf_utils.logColors as lc
def change_license(license: str) -> None:
try:
if not license:
print(f"{lc.r}License cannot be empty!{lc.rs}")
return
if "_" not in license:
print(f"{lc.r}Invalid license!{lc.rs}")
return
conn = sqlite3.connect("database.db")
cursor = conn.cursor()
cursor.execute(
"INSERT OR REPLACE INTO settings (name, value) VALUES ('license', ?)",
(license,),
)
conn.commit()
conn.close()
print(f"{lc.g}License changed successfully!{lc.rs}")
except Exception as e:
print(f"{lc.r}Error changing license!{lc.rs}")
print(f"{lc.r}{e}{lc.rs}")
def main():
license = input(f"\n{lc.g}Enter the new license: {lc.rs}")
change_license(license)
if __name__ == "__main__":
main()