I want to create a bot to post my texts to a channel... Can anyone help me with the code?
this is the code that I tried :
import telegram
token = "5002307835:AAGOu4f******************"
chat_id = "1382******"
bot = telegram.Bot(token)
def send_message(message):
return bot.send_message(chat_id,message)
send_message("HI")
but i got this error : telegram.error.BadRequest: Chat not found
also i tried : chat_id = "-1382******" and chat_id = -1382****** and chat_id = 1382******
python-telegram-botit seems you're using old formatting, see