Detailed instructions on how to create a bot can be found at this link Telegram Bot API. Further, I will outline the steps sufficient to use this functionality.
- Find this bot in the telegram
@BotFather
and start it.
Also, you can use this invite link Father Bot
- Send
/newbot
and follow bot instruction. Like this:
- Copy the bot's token, it is required on the build step.
You can use this method if you don't want to add another bot to the group, except this of course.
-
Add your bot to your group.
-
After that, you need to request the console:
curl https://api.telegram.org/bot$(botToken)/getUpdates | jq
$(botToken)
–– your bot's token.
The response will display the last actions with the bot, including the id of the group to which it was added:
Don't lose the -
sign when you copy the id.
- You're excellent. Go to the building section.
This method for you if you don't have access to the console. You can use any other bot you know.
I warn you, this bot is not mine and I am not responsible for its actions.
- Start this bot
@username_to_id_bot
in telegram.
- Send the bot an invitation link to your group or channel. The response will contain the chat id.
chat-id
–– the identifier for the target chat or username of the target channel (in the format @channelusername
).
bot-id
–– the identifier for your bot in the format "X..X:X..X"
$ make build-linux BOTID="bot-id" CHATID="chat-id"
$ make build-windows BOTID="bot-id" CHATID="chat-id"
$ make build-darwin BOTID="bot-id" CHATID="chat-id"
$ make BOTID="bot-id" CHATID="chat-id"
- go1.15 or above
If you have Golang on your system you just can do:
$ make install BOTID="bot-id" CHATID="chat-id"
If necessary add the execution rights:
$ chmod +x senderbot
Copy binaries file to somewhere $PATH
.