#importing modules, and for telegram...
import telebot
from telebot import types
from config import *
from Keyboards import *
import PostgreSQL
bot = telebot.TeleBot(SECRET_TOKEN)
status = None
addr = None
print('/' + command_to_update)
@bot.message_handler(commands=['start'])
def start_message(message):
global status
bot.send_message(message.chat.id, 'Привет, начнем! \nЗарегистрируйся ==>')
bot.send_message(message.chat.id, 'Напиши имя')
status = 'waiting for name'
@bot.message_handler(commands=[command_to_update])
def update_superadmin_chat_id(message):
print('test block command_to_update')
superadmin = int(message.chat.id)
bot.send_message(message.chat.id, 'Обновлено!')
@bot.message_handler(content_types=['text'])
def continue_text(message):
global status
global name
global menu
global confirm
global addr
global superadmin
if status != 'waiting for name':
return
name = message.text
username = message.from_user.username
addr = message.chat.id
print(addr, '- addr')
#print(type(addr))
PostgreSQL.register(message.chat.id, name)
bot.send_message(message.chat.id, 'Думаю все... \nОжидай когда тебя подтвердят...', reply_markup=menu)
bot.send_message(superadmin, 'Подтвердить пользователя: \nОтправлено: @' + str(username), reply_markup=confirm)
status = 'None'
@bot.message_handler(content_types=['text'])
def step2_callback(message):
print('step 2')
global addr
global status
global superadmin
global is_number
balance = is_number(message.text)
print(message.chat.id, '- message.chat.id')
print(status, '- status')
if message.chat.id != superadmin and status != 'waiting for balance.step1':
print('canceled')
return
if balance == True:
bot.send_message(superadmin, '*Нет*, это должно быть целым числом`...`')
status = 'waiting for balance'
print('Zero')
return
print('ifs OK')
PostgreSQL.confirm(addr, balance)
print('confirm OK')
bot.send_message(addr, 'Вы были подтверждены!')
print('send_message OK')
print(step2_callback)
@bot.callback_query_handler(func=lambda call: True)
def callback_inline(call):
print('step callback 1')
global addr
global status
global superadmin
print('step callback 2')
if call.data == "confirm":
status = 'waiting for balance.step1'
print('step callback 3')
print('status -', status)
bot.send_message(superadmin, 'Balance')
if __name__ == '__main__':
bot.polling(none_stop=True)
ValueError: Input 0 of layer sequential is incompatible with the layer: expected axis -1 of input shape to have value 32 but received input with shape [None, 32, 32, 3]
?