bot.send_message(message.chat.id, random.randint(1,5), reply_markup=keyboard) Код bot.send_message(message.chat.id, random.randint(1,5), reply_markup=keyboard) Как реализовать чтобы если было, например 5 отправлялась картинка
хз не особо шарю в питоне(от слова совсем) bot.send_message(message.chat.id, random.randint(1,5), reply_markup=keyboard) if bot.send_message == '5': там чё та питонисты не бейте я нихуя не понимаю
Шестерикн, bot.send_message(message.chat.id, random.randint(1,5), reply_markup=geyboard) if bot.send_message == '5': bot.send_photo(message.chat.id, 'https://i.imgur.com/pyton.jpg') Python bot.send_message(message.chat.id, random.randint(1,5), reply_markup=geyboard) if bot.send_message == '5': bot.send_photo(message.chat.id, 'https://i.imgur.com/pyton.jpg')
import random picture = 'https://zelenka.guru/public/2021/ny.gif' random = random.randrange(1,5) if random == 5: bot.send_photo(message.chat.id, picture) else: bot.send_message(message.chat.id, 'Было сгенерировано другое число', reply_markup=keyboard) Python import random picture = 'https://zelenka.guru/public/2021/ny.gif' random = random.randrange(1,5) if random == 5: bot.send_photo(message.chat.id, picture) else: bot.send_message(message.chat.id, 'Было сгенерировано другое число', reply_markup=keyboard)
id618477438, так естественно оно будет генерироваться только при запуске бота. Необходимо сделать так, например, чтобы оно генерировалось по нажатию кнопки. Нужна помощь?