In my own library I'm trying to send a message using "sendMessage" API method from Telegram Bot API. I've create a channel titled, say, "my_channel123" and my user name is "my_username123". So I'm an admin of the channel and the only user.
When I'm trying to send a message to the whole channel or myself from a bot, I get an error Bad request 400
. Here's how I'm trying to do that:
my_bot.send_message(chat_id="@my_channel123", text="tetfdsfd")
# or
my_bot.send_message(chat_id="@my_channel123my_username123", text= "tetfdsfd")
# or
my_bot.send_message(chat_id="@my_username123", text="tetfdsfd")
I believe the error is somewhere in the format of the ids of the channel or user name or both. Are all these 3 calls correct, meaning is the format I use for chat_id correct?
Note that most likely the probable case is the id of the chat or user_name (or rather, the format) or something else because other post and get methods in my library work properly.