Publish message to telegram Public Channel

Dear All;
I have developoed an analysis tool using Google Apps Script which utilizes Javascript. I need to publish the output to a public telegram channel. I did followings:

  1. I prepared a public channel.

  2. I created a bot using botFather.

  3. I made the bot as the administrator of public channel.

  4. then I made the following HTTP GET request without success:

    var myUrl = ‘[MY_BOT_TOKEN]/sendmessage?chat_id =MY_CHANNEL_NAME&text=’ + myMessage;
    ** UrlFetchApp.fetch(myUrl);**

The fetch command returns this error:

Exception: Invalid argument:

Please somebody help me to solve this problem.

I thank you very much for soonest response.

Best Regards

You have to append your token directly to “” I can see an opening bracket “(” in the error message url.

If your bot token is “Je3nf5Il6rHfDN340” then the URL will be:
Je3nf5Il6rHfDN340/sendmessage?chat_id= MY_CHANNEL_NAME&text= myMessage

first: remove the bracket “(”
2nd: place this token in the ‘telegram_bot_id’ variable in the file correctly.
By correctly i mean it should be placed as
(important is u should place ‘bot’ word before https.
Like this reply if you got it solved

thank you very much.
it was realy good.