фильм❓" and randfilm == "1":
await bot.send_photo(message.chat.id, types.InputFile("pictures/1+1.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "2":
await bot.send_photo(message.chat.id, types.InputFile("pictures/beremen.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "3":
await bot.send_photo(message.chat.id, types.InputFile("pictures/bessmertnie.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "4":
await bot.send_photo(message.chat.id, types.InputFile("pictures/help.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "5":
await bot.send_photo(message.chat.id, types.InputFile("pictures/joker.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "6":
await bot.send_photo(message.chat.id, types.InputFile("pictures/jon.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "7":
await bot.send_photo(message.chat.id, types.InputFile("pictures/kras_uv.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "8":
await bot.send_photo(message.chat.id, types.InputFile("pictures/masorgrom.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "9":
await bot.send_photo(message.chat.id, types.InputFile("pictures/trans.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "10":
await bot.send_photo(message.chat.id, types.InputFile("pictures/unchar.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "11":
await bot.send_photo(message.chat.id, types.InputFile("picture/victor.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "12":
await bot.send_photo(message.chat.id, types.InputFile("pictures/voinamirov.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "13":
await bot.send_photo(message.chat.id, types.InputFile("pictures/scary.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "14":
await bot.send_photo(message.chat.id, types.InputFile("pictures/major.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "15":
await bot.send_photo(message.chat.id, types.InputFile("pictures/american.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "16":
await bot.send_photo(message.chat.id, types.InputFile("pictures/tom.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "17":
await bot.send_photo(message.chat.id, types.InputFile("pictures/bogatir.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "18":
await bot.send_photo(message.chat.id, types.InputFile("picture/jeck.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "19":
await bot.send_photo(message.chat.id, types.InputFile("pictures/povorot.jpg"))
if message.text == "Рандомный фильм❓" and randfilm == "20":
await bot.send_photo(message.chat.id, types.InputFile("pictures/nile.jpg"))
Парни в чем ошибка? Не дает фото. Путь указан правильный, консоль чистая. Рандом работает.
создай файл. __init__.py
Это ему как поможет..
И твой код можно чуток упростить. @dp.message_handler(content_types=['text']) async def randfilmec(message): randfilm = random.randint(1,20) msg_txt = message.text[3] if message.text == "1": await bot.send_photo(message.chat.id, types.InputFile(f"pictures/1+1.jpg")) Можно вроде и так сделать еще (заместь названий фильма, просто укажи цыфру @dp.message_handler(content_types=['text']) async def randfilmec(message): randfilm = random.randint(1,20) await bot.send_photo(message.chat.id, types.InputFile(f"pictures/{randfilm}.jpg"))
Стоп, я немного про***л*ся с кодом
Звёздочка лишняя
ЧТо я блять вообще тут написал... 😄
Обсуждают сегодня