ANTICHAT

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

akitanoname 05.01.2024 18:49

python:





Код:

@bot.message_handler
(
content_types
=
[
'text'
]
)
def
text_reply
(
message
)
:
if
message
.
reply_to_message
==
"поцеловать"
:
bot
.
send_message
(
message
.
from_user
.
id
,
"пися попа члеен"
)



как сделать проверку на то, что мое сообщение является именно ОТВЕТОМ и содержит в себе слово ПОЦЕЛОВАТЬ

Fott 05.01.2024 19:09

Python:





Код:

@bot.message_handler
(
func
=
lambda
message
:
message
.
reply_to_message
is
not
None
)
def
text_reply
(
message
)
:
text
=
message
.
text
.
lower
(
)
if
text
==
"поцеловать"
:
bot
.
send_message
(
message
.
from_user
.
id
,
"пися попа члеен"
)
bot
.
polling
(
)



Время: 06:49