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:
- Give the administator permissions to the bot
- Used @mychannelname instead of message.chat.id while invoking send_message
- Written smthg in channel cause bot can reply only if you already written him.