
19.04.2024, 21:35
|
|
Участник форума
Регистрация: 07.05.2022
Сообщений: 142
С нами:
2117009
Репутация:
33
|
|
Сообщение от лимаров
asd:
Код:
import
telebot
botTimeWeb
=
telebot
.
TeleBot
(
'6830548762:AAEwhwDqk4DPskbXCHgp8fI_FuhGbKbwPFI'
)
from
telebot
import
types
@botTimeWeb.message_handler
(
commands
=
[
'start'
]
)
def
startBot
(
message
)
:
first_mess
=
f"{message.from_user.first_name}{message.from_user.last_name}, привет!Хочешь расскажу немного о нашей компании?"
markup
=
types
.
InlineKeyboardMarkup
(
)
button_yes
=
types
.
InlineKeyboardButton
(
text
=
'Да'
,
callback_data
=
'yes'
)
markup
.
add
(
button_yes
)
botTimeWeb
.
send_message
(
message
.
chat
.
id
,
first_mess
,
parse_mode
=
'html'
,
reply_markup
=
markup
)
@botTimeWeb.callback_query_handler
(
func
=
lambda
call
:
True
)
def
response
(
function_call
)
:
if
function_call
.
message
:
if
function_call
.
data
==
"yes"
:
second_mess
=
"Мы облачная платформа для разработчиков и бизнеса. Более детально можешь ознакомиться с нами на нашем сайте!"
markup
=
types
.
InlineKeyboardMarkup
(
)
markup
.
add
(
types
.
InlineKeyboardButton
(
"Перейти в наш оффициальный телеграм канал"
,
url
=
"https://t.me/brandshopnsk"
)
)
botTimeWeb
.
send_message
(
function_call
.
message
.
chat
.
id
,
second_mess
,
reply_markup
=
markup
)
botTimeWeb
.
answer_callback_query
(
function_call
.
id
)
botTimeWeb
.
infinity_polling
(
)
тебе нужно юзернейм? или имя и фамилию?
|
|
|