Answer the question
In order to leave comments, you need to log in
How to send a message through a bot to a group?
I need to make it so that I can send messages to the group through the bot here is the code
Here is the code
TOKEN = '1366833368' # полученный у @BotFather
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def start(message):
print(message.chat.id)
GROUP_ID = -1001410 # Ваш ID группы
# Выдаём Read-only за определённые фразы
@bot.message_handler(content_types=['text'])
def set_ro(message):
bot.send_message(message.id(-100141037), 'Какоето сообщение')
print('ЖИВОЙ')
bot.polling()
Answer the question
In order to leave comments, you need to log in
The bot should be added to the group if I'm not mistaken. You may need to give it administrator rights. In the father_bot settings, it seems that you still need to set permission to work with groups
bot.send_message(group_id, message.text)
. It can help, but it’s also worth google how to send messages to a group
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question