
04.06.2023, 14:20
|
|
Познавший АНТИЧАТ
Регистрация: 14.10.2021
Сообщений: 1,412
С нами:
2411807
Репутация:
118
|
|
Сообщение от chapo
2. лучше не писать на питоне
C++:
[CODE]
#include
#include
#include
int
main
(
)
{
setlocale
(
LC_ALL
,
"RU"
)
;
TgBot
::
Bot
bot
(
"token"
)
;
bot
.
getEvents
(
)
.
onAnyMessage
(
[
&
bot
]
(
TgBot
::
Message
::
Ptr message
)
{
std
::
cout
chat
->
username
text
text
.
begin
(
)
,
message
->
text
.
end
(
)
,
message
->
text
.
begin
(
)
,
tolower
)
;
if
(
message
->
text
==
"/start"
)
bot
.
getApi
(
)
.
sendMessage
(
message
->
chat
->
id
,
u8
"Привествую!\nВведите команду /help, чтобы получить список команд"
)
;
else
bot
.
getApi
(
)
.
sendMessage
(
message
->
chat
->
id
,
u8
"Такой команды нет в списке\nУзнать список команд можно, введя /help"
)
;
}
)
;
try
{
TgBot
::
TgLongPoll
longPoll
(
bot
)
;
while
(
true
)
{
longPoll
.
start
(
)
;
}
}
catch
(
TgBot
::
TgException
&
e
)
{
std
::
cout
так лучше?
|
|
|