Тема: Bot Telegram
Показать сообщение отдельно

  #12  
Старый 06.02.2020, 17:33
Dmitriy Makarov
Флудер
Регистрация: 29.04.2017
Сообщений: 2,512
С нами: 4757849

Репутация: 183


По умолчанию

Цитата:
Сообщение от zheki444  

Добавь модуль Proxy
Другой API попробовал.

Python:





Код:
from
telegram
import
Bot
from
telegram
import
Update
from
telegram
.
ext
import
Updater
from
telegram
.
ext
import
MessageHandler
from
telegram
.
ext
import
Filters

TOKEN
=
'Токен'
def
message_handler
(
bot
:
Bot
,
update
:
Update
)
:
user
=
update
.
effective_user
if
user
:
name
=
user
.
first_name
else
:
name
=
'аноним'
text
=
update
.
effective_message
.
text
    reply_text
=
f'Привет,{name}!\n\n{text}'
bot
.
send_message
(
chat_id
=
update
.
effective_message
.
chat_id
,
text
=
reply_text
,
)
def
main
(
)
:
bot
=
Bot
(
token
=
TOKEN
,
base_url
=
'https://telegg.ru/orig/bot'
,
)
updater
=
Updater
(
bot
=
bot
,
use_context
=
True
,
)
handler
=
MessageHandler
(
Filters
.
all
,
message_handler
)
updater
.
dispatcher
.
add_handler
(
handler
)
updater
.
start_polling
(
)
updater
.
idle
(
)


Но и он, к сожалению, не реагирует. .-.

Цитата:
Сообщение от Спойлер  




 
Ответить с цитированием