Возникло исключение: IndexError
string index out of range
File "C:\Users\YOKA\Desktop\main.py", line 13, in encrypt
encrypted = encrypted + alphabet [newPosition]
File "C:\Users\YOKA\Desktop\main.py", line 53, in msg_encrypt
bot.send_message(message.chat.id, f"{encrypt(ltstr(arg[0:-1]), key)}")
File "C:\Users\YOKA\Desktop\main.py", line 86, in <module>
bot.polling()
@bot.message_handler(content_types=['text'])
def send_text(message):
if message.text =="text":
text= bot.send_message(message.chat.id, 'Текст для шифра')
elif message.text == "s":
s = bot.send_message(message.chat.id, "Укажите шаг")
bot.register_next_step_handler(s, save_s)
def save_text(message):
global save_text
save_text = message.text
def save_s(message):
global save_s
save_s = message.text