@bot.message_handler(commands=['start'])
def get_document_query(message):
# CREATE REQUEST
body = {"UserId": message.from_user.id, "UserName": message.from_user.username, "UserFirstName": message.from_user.first_name, "UserLastName": message.from_user.last_name, "ProjectKey": config.project_key}
us_r = requests.post('https://mindscan.ru/Outer/GetToken', data=body)
text = 'Введите поисковый запрос'
data = json.loads(us_r.text)
token = data.get('Jwt')
# SAVE TOKEN
with sqlite3.connect(config.db_name) as conn:
cursor = conn.cursor()
stmt = "INSERT INTO users VALUES (NULL, :username, :token)"
args = {'username': message.from_user.username, 'token': token}
cursor.execute(stmt, args)
print(conn.commit())