-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
145 lines (119 loc) · 4.7 KB
/
main.py
File metadata and controls
145 lines (119 loc) · 4.7 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import time
import random
import os
# Функция для очистки консоли
def clear_console():
os.system('clear') # Очистка для Linux/Mac
# Для Windows используйте os.system('cls')
# Функция для отображения экрана загрузки с рандомным прогресс-баром
def loading_screen():
clear_console()
print("Загрузка... [", end='', flush=True) # Начало прогресс-бара
for _ in range(20):
time.sleep(random.uniform(0.1, 0.5)) # Рандомная задержка от 0.1 до 0.5 секунд
print("█", end='', flush=True) # Отображение символа "█" без переноса строки
print("] 100%...")
loading_screen()
def loading_message(message):
print(f"Loading {message}...", end='', flush=True)
time.sleep(0.9)
print(" OK", end='', flush=True)
print()
loading_message("colors")
from termcolor import colored
loading_message("sql")
import sqlite3
loading_message("menu")
time.sleep(0.1)
clear_console()
text = colored("BOT CODE CREATOR", "red")
print(f'\n{text}\n')
text = colored("v1.2", "yellow")
print(f'\n{text}')
text = colored("Made By t.me/Autoritetion", "yellow")
print(f'{text}\n')
loggined = False # Инициализируем флаг, который будет указывать, вошел ли пользователь
def help():
txt_to_text = """
What? Help? Really?"""
text = colored(txt_to_text, "yellow")
main()
def start():
text = colored("Enter password>>> ", "blue")
user_password = input(f'{text}')
# Подключаемся к базе данных SQLite3
db_connection = sqlite3.connect("psdb.db") # Замените на путь к вашей базе данных
if db_connection is not None:
cursor = db_connection.cursor()
# Выполняем SQL-запрос для поиска пароля
cursor.execute("SELECT password FROM pas WHERE password = ?", (user_password,))
# Получаем результат запроса
result = cursor.fetchone()
if result:
text = colored("Successfully!", "green")
print(text)
global loggined
loggined = True
else:
text = colored("Wrong password", "red")
print(text)
start()
# Закрываем соединение с базой данных SQLite3
cursor.close()
db_connection.close()
else:
print("Unable to connect to the database.")
def generate_bot_code():
# Здесь вы можете генерировать код Telegram бота на основе запросов пользователя
# Например, вы можете запросить у пользователя имя бота, токен и другие параметры
bot_name = input("Enter your bot's name: ")
bot_token = input("Enter your bot's token: ")
# Генерируйте код на основе введенных параметров
bot_code = f'''
from telegram import Bot
bot = Bot(token="{bot_token}")
def main():
bot.send_message(chat_id=message.chat.id, text="Hello, World!")
if __name__ == "__main__":
main()
'''
# Выведите сгенерированный код
print("Generated code for the Telegram bot:")
print(bot_code)
main()
def main():
start()
if loggined == True:
def log():
text = colored("1. Create new code\n2. Info\n3. Exit", "red")
print(f'\n{text}')
text = colored(">>> ", "blue")
nb = int(input(text))
# dashboard
if nb == 1:
clear_console()
text = colored("1. Generate code\n2. Codes\n3. Exit", "red")
print(f"\n{text}")
text = colored(">>> ", "blue")
nbt = int(input(text))
if nbt == 1:
generate_bot_code() # Вызываем функцию генерации кода для Telegram бота
elif nbt == 2:
text = colored("Check update!.", "yellow")
print(f'\n{text}')
log()
elif nbt == 3:
clear_console()
exit(-1)
elif nb == 2:
text = colored("This code can help you create code for Telegram bot", "yellow")
print(f'\n{text}')
log()
elif nb == 3:
clear_console()
exit(-1)
log()
else:
start()
if __name__ == "__main__":
main()