0% found this document useful (0 votes)
71 views1 page

Script To Send Message

To create a Telegram bot that can send messages to a group or channel, you must first create the bot through BotFather to get an API token, create a channel and add the bot as a member, then post a test message to get the channel ID from the response which identifies the channel the bot can send messages to.

Uploaded by

Mohammad Irfan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views1 page

Script To Send Message

To create a Telegram bot that can send messages to a group or channel, you must first create the bot through BotFather to get an API token, create a channel and add the bot as a member, then post a test message to get the channel ID from the response which identifies the channel the bot can send messages to.

Uploaded by

Mohammad Irfan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Create telegram bot

To send a message to Telegram group or channel, you should first create your own
bot. Just open Telegram, find @BotFather and type /start. Then follow instructions
to create bot and get token to access the HTTP API.

Create Channel
Create a new Channel in Telegram and add your bot as a member. So your bot could
send messages to the Channel.

In order to get Channel Id, first, post any message to the Channel. Then use this
link template to get Channel Id:

https://api.telegram.org/bot<YourBOTToken>/getUpdates

Here is a response example:


{
"ok":true,
"result": [
{
"update_id":123,
"channel_post": {
"message_id":48,
"chat": {
"id":-123123123, // this is your channel id
"title":"Notifications",
"type":"channel"
},
"date":1574485277,
"text":"test"
}
}
]
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy