169 похожих чатов

@Dp.Message_handler(Content_types=['Text']) Async def randfilmec(message): randfilm = random.randint(1,20) if message.text == "Рандомный

фильм❓" 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"))
Парни в чем ошибка? Не дает фото. Путь указан правильный, консоль чистая. Рандом работает.

7 ответов

17 просмотров

создай файл. __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"))

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
14
Добрый день! Скажите пожалуйста, а какие программы вы бы рекомендовали написать для того, чтобы научиться управлять памятью? Можно написать динамический массив, можно связный ...
Филипп
7
Недавно Google Project Zero нашёл багу в SQLite с помощью LLM, о чём достаточно было шумно в определённых интернетах, которые сопровождались рассказами, что скоро всех "ибешни...
Alex Sherbakov
5
Ребят в СИ можно реализовать ООП?
Николай
33
https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_h_common.erl#L174 https://github.com/erlang/otp/blob/OTP-27.1/lib/kernel/src/logger_olp.erl#L76 15 лет назад...
Maksim Lapshin
20
Карта сайта