vinobad.blogg.se

Online telegram login
Online telegram login








Owner of all files in /usr/bin is root user. Sudo mv telegram-send.sh /usr/bin/telegram-send telegram-send.sh add it to /usr/bin/ folder 1 In order to use this script from everywhere and type telegram-send instead. To run this script we should add permission 1 Also, you could limit actions your bot could do in the Channel only to send messages. It is not a good practice to store your token in that place, but for now, it is ok. For string with spaces put it on quotes"Ĭurl -s -data "text= $1" -data "chat_id= $GROUP_ID" '' $BOT_TOKEN '/sendMessage' > /dev/null # this 3 checks (if) are not necessary but should be convenientĮcho "Usage: `basename $0` \"text message\""Įcho "Add message text as second arguments"Įcho "You can pass only one argument. So we will create a linux terminal command telegram-send and could send messages with this simple command. In order to send a message we could use simple command: 1īut in programming, it is good practice to hide the low-level implementation. Then use this link template to get Channel Id: In order to get Channel Id, first, post any message to the Channel. So your bot could send messages to the Channel. Create ChannelĬreate a new Channel in Telegram and add your bot as a member. Then follow instructions to create bot and get token to access the HTTP API. Just open Telegram, find and type /start. To send a message to Telegram group or channel, you should first create your own bot. Then you will use this script to send a notification on every ssh login into your server.Ĭheck my Telegram VPN bot if you need personal private VPN. In this article, you will walk through the creation of a simple Bash shell script to send messages to Telegram messenger using the Curl command.










Online telegram login