Почему виводит ошибку?
Вот код:
@bot.message_handler(commands=['start'])
def start(message):
time.sleep(5)
user_id = message.chat.id
my_channel_id = -1001722012910
statuss = ['creator', 'administrator', 'member']
for i in statuss:
if i == bot.get_chat_member(chat_id=my_channel_id, user_id=message.from_user.id).status:
bot.send_message(message.chat.id, 'Привет')
break
else:
markup = types.InlineKeyboardMarkup()
button1 = types.InlineKeyboardButton("Подписаться", url='https://t.me/......')
button2 = types.InlineKeyboardButton("Подписаться", url='https://t.me/.....')
markup.add(button1, button2)
bot.send_sticker(message.chat.id, "CAACAgIAAxkBAAIU7WPiUH_F3LRfcnuqPKG5x8VxqhItAAKNJgACWPrxShVcqS6dZHPYLgQ")
bot.send_message(message.chat.id, "А подписочку?\nПосле того как подписался, напиши /start", reply_markup=markup)
Вот ошибка:
UnboundLocalError: cannot access local variable 'markup' where it is not associated with a value