A
A
Avaki2019-06-16 23:26:34
Python
Avaki, 2019-06-16 23:26:34

How to make telebot send messages to a group without referring to it?

There is a code, but the bot only responds when I refer to it
. How can I make it write after each user message?

import telebot

bot = telebot.TeleBot("токен")

@bot.message_handler(content_types=['text'])
def start_message(message):
  if message.text.lower() == 'привет':
    bot.send_message(message.chat.id, 'Привет')

bot.polling()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Trainin, 2019-06-17
@Stormx480

No way. Bots don't start conversations on their own. Take advantage of the client. telethon library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question