Y
Y
YZYZ2020-08-25 11:58:58
Chats
YZYZ, 2020-08-25 11:58:58

Where to enter the code for sending messages to telebot?

I have a telegram bot. I want to make the bot send parsed news to one person, but I don't know where exactly to enter the code for sending messages. The bot should always check if there is new news and send it to the chat. I have already made the parser itself, but now I don’t know where to put it supposedly, it should do all this separately from the bot itself.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-08-25
@shurshur

And what's so difficult?

bot = telebot.TeleBot(TOKEN)

for news in array_of_parsed_news_to_send:
  bot.send_message(YOUR_USER_CHAT_ID, news)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question