-1

upd: 09.11.20 SOlVED I've made the telegram bot that working good in single conversations of a groups. However right now I want it to send messages right in my channel.

When I'm writing script(after i write straigt to the bot to invoke it by command /start)

import telebot
token = '...'
bot = telebot.TeleBot(token)

@bot.message_handler(commands=['start'])
def default_test(message):

    answer = 'Привет!'
    bot.send_message('@hello_danishere', answer)

bot.polling(none_stop=True, interval=0)

or doing a html query https://api.telegram.org/bot/sendMessage?chat_id=@hello_danishere&text=123 i'm getting an error. {"ok":false,"error_code":400,"description":"Bad Request: chat not found"}

I've already done this things that found in internet:

  1. Give the administator permissions to the bot
  2. Used @mychannelname instead of message.chat.id while invoking send_message
  3. Written smthg in channel cause bot can reply only if you already written him.

1 Answers1

0

SOlVED. The thing is you need to check three things to success: 1.Your channel responding to link t.me/<nameofPUBLICchannel 2.Your bot has administrative permissions 3.You've already posted smtng on your channel

That helped me