Просмотр полной версии : менюшка бота telegram
https://forum.antichat.xyz/attachments/28524443/img_2e6e2d88be.png
Знает кто то как сделать такое меню и как добавить к сообщению бота фотографию? если нужен код, скину
chromiusj
29.07.2024, 21:54
sendPhoto - aiogram 3.27.0 documentation
sendPhoto - aiogram 3.27.0 documentation
а с панелькой? насчет форума не ебу даже в пайтоне нихуя
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")
На будущее: твоя "Менюшка" называется - Инлайн кнопки.
vBulletin® v3.8.14, Copyright ©2000-2026, vBulletin Solutions, Inc. Перевод: zCarot