небольшие фиксы

This commit is contained in:
sitisll
2023-03-10 13:40:50 +03:00
parent 13abda9b19
commit e7042063e8
2 changed files with 8 additions and 10 deletions

View File

@@ -28,10 +28,9 @@ def start():
create_config(key_api)
else:
x = input("Уже есть запомненный ключа api. Запустить его? Y/n \n")
if x == "":
x = "y"
elif x == "y":
if x == "" or x.lower == 'y':
read_config()
elif x == "n":
os.remove(f"{hlna.home_dir}/.config/hlna/bot/hlna_bot")
start()
@@ -56,16 +55,14 @@ def read_config():
def create_config(key_api):
k_api = key_api
config_hlna_bot = [
{
'key_api': k_api,
'key_api': key_api,
}
]
with open(f"{hlna.home_dir}/.config/hlna/bot/hlna_bot", 'w') as yamlfile:
yaml.dump(config_hlna_bot, yamlfile)
print(colorama.Fore.GREEN + "Конфиг бота создан" + colorama.Style.RESET_ALL)
return k_api
start()