Telegram output error

If the rest of your code is correct, then check if all the details in the conf.py file are correct. I got the same error and I just had to correct something in conf.py. Hopefully this solves your problem.

1 Like

I have checked but it is still showing error

If you are absolutely sure there is nothing wrong with the code, then try deleting the channel and bot you created and set it up again.
The same thing happened to me and doing the above steps helped me.
Hope this helps you too…:grinning:

Hi @shivamdixit1712,

  1. Check if your device is online first.
    2. As discussed over the support-

As you can see in the telegraph app screenshot, the url of t.me is
t.me/Temprature_conf_bot

in that case, your telegraph telegram_chat_id would be -

telegram_chat_id = "@Temprature_conf_bot"

But you have entered the wrong telegram_chat_id in your conf file.

Also you bot id is incorrect. The syntax for the bot id is

telegram_bot_id = "botXXXX"  # This is the bot ID of the created Telegram Bot. Paste after bot text.

now check your code you started your bot id with bot: (colon) but in the syntax is it just bot

Copy the whole token as it is and add the bot at starting. You also missed the colon after 6674 in your bot it.

Sir i have corrected all the mistakes as you said but i am still getting an error on running the code

Hi @shivamdixit1712,

As you have shared your code on the support, we find that there is a typo error. telegram_chat_id value is case sensitive. So use the same text that is being shown in the telegram app.

Sir i have corrected it again but the error is still there on running my code

Hello shivamdixit1712,
Try adding your bot to another channel and use that channel name as the chat id.
Sometimes the channel id may not have generated correctly and thus the device may not recognize it.

My code worked thanks for your help the main issue was typing error in chat id and bot id

I am sending a massage to the telegram for my own understanding how it works but unfortunately i am stuck in this error which i have already gone through all the previous link to rectify my error but any how it is throwing me an error. can you help me out.
Here is my code:
telegram%20coding

Here is the out:

Here is my telegram configuration file
tele%20conf

even after correcting my typo error in telegram_data[“OK”] to telegram_data[“ok”]
still it shows me the error: