def getAccess(user_id):
with sqlite3.connect('users.db') as conn:
cursor = conn.cursor()
cursor.execute('SELECT user_group_id FROM users WHERE user_id=?',(user_id,))
result = cursor.fetchall()
return result
@bot.message_handler(commands=['auth'])
def Authorization(message):
access = getAccess(message.chat.id)
if access:
for acc in access:
if acc == 1:
bot.send_message(message.chat.id,'Привет Admin!')
else:
bot.send_message(message.chat.id,'Привет User!')
else:
bot.send_message(message.chat.id,'Вы не зарегистрированны в системе!')
elif message.text == 'Случайная песня':
files = os.listdir('songs1')
list = []
for x in files:
list.append(x)
song = random.choice(list)
bot.send_audio(message.chat.id, song)
elif message.text == 'Случайная песня':
song = random.choice([x for x in os.listdir('songs1')])
bot.send_audio(message.chat.id, song)
TypeError: register_next_step_handler() missing 1 required positional argument: 'callback'