Answer the question
In order to leave comments, you need to log in
How to replace input() in this code so that the value can be entered through the bot?
How to replace input() in this code so that the title can be entered through the bot?
def duplicate_sheet(message: types.Message):
wks_start = gc.open ('Test').get_worksheet (0)
bot.send_message (message.chat.id, 'Введите название листа: ')
new_sheet_name = input ('Input sheet name:')
# new_sheet_name = message.text
while new_sheet_name in list_sheets ():
bot.send_message (message.chat.id,'Таблица "{0}" уже существует. Введите другое название.'.format (new_sheet_name))
new_sheet_name = input ('Input sheet name:')
bot.send_message (message.chat.id,'Таблица "{0}" создана .'.format (new_sheet_name))
Answer the question
In order to leave comments, you need to log in
Insert at the beginning, and enter / start in the telegram
@bot.message_handler(commands=['start'])
def start(message):
bot.send_message (message.chat.id, 'Введите название листа: ')
bot.send_message (message.chat.id, 'Введите название листа: ')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question