ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Общие вопросы программирования (https://forum.antichat.xyz/forumdisplay.php?f=206)
-   -   менюшка бота telegram (https://forum.antichat.xyz/showthread.php?t=1517268)

джигаут 29.07.2024 21:52

https://forum.antichat.xyz/attachmen...2e6e2d88be.png

Знает кто то как сделать такое меню и как добавить к сообщению бота фотографию? если нужен код, скину

chromiusj 29.07.2024 21:54

sendPhoto - aiogram 3.27.0 documentation

джигаут 29.07.2024 21:56

Цитата:

Сообщение от chromiusj

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")

xtr 31.07.2024 15:40

На будущее: твоя "Менюшка" называется - Инлайн кнопки.

ferzin 17.08.2024 14:35

aiogram + aiogram_dialog


Время: 17:01