Add qbt function

This commit is contained in:
trueold89 2023-10-31 03:45:12 +03:00
parent ae8005b7e9
commit 43e823b1ec
Signed by: trueold89
GPG Key ID: C122E85DD49E6B30
2 changed files with 13 additions and 0 deletions

1
bot.py Normal file → Executable file
View File

@ -158,4 +158,5 @@ def unknown(message):
else: else:
bot.reply_to(message,'Этот бот запривачен, гнида, блять') bot.reply_to(message,'Этот бот запривачен, гнида, блять')
func.qbt()
bot.polling() bot.polling()

12
func.py
View File

@ -4,6 +4,18 @@
import db, os import db, os
from db import * from db import *
def qbt():
url = os.environ['QURL']
username = os.environ['QUSER']
password = os.environ['QPASS']
commands = [
f"qbt settings set url {url}",
f"qbt settings set username {username}",
f"echo {password} | qbt settings set password --no-warn"
]
for command in commands:
os.system(f"bash -c '{command}'")
def u_auth(id,passwd): def u_auth(id,passwd):
list = [] list = []
if db.check('obj',AUTH_FILE): if db.check('obj',AUTH_FILE):