| Makaroshka_0511 |
30.07.2024 19:38 |
Смотря какая библиотека
Python:
Код:
import
telebot
from
telebot
import
types
bot
=
telebot
.
TeleBot
(
'TOKEN'
)
f
=
open
(
'photo.jpg'
,
'rb'
)
@bot.message_handler
(
commands
=
[
'start'
]
)
def
main
(
message
)
:
markup
=
types
.
InlineKeyboardMarkup
(
row_width
=
1
)
bt1
=
types
.
InlineKeyboardButton
(
'TEXT'
,
callback_data
=
'text'
)
bt2
=
types
.
InlineKeyboardButton
(
'TEXT'
,
callback_data
=
'text1'
)
bt3
=
types
.
InlineKeyboardButton
(
'TEXT'
,
callback_data
=
'text2'
)
markup
.
add
(
bt1
,
bt2
,
bt3
)
bot
.
send_photo
(
message
.
chat
.
id
,
f
,
reply_markup
=
markup
)
bot
.
polling
(
non_stop
=
True
)
На библиотеке pyTelegramBotAPI
Чтобы добавить сообщение о выборе, просто добавь перед
Код:
bot.send_photo(message.chat.id, f, reply_markup=markup)
Код:
bot.send_message(message.chat.id, "TEXT")
|