sudo apt install -y curl gpg jq
gpg --import private.key
curl -O "https://raw.githubusercontent.com/emmtte/save/main/{backup.sh,backup.txt}"
- Use the /newbot command to create a new bot. The BotFather will ask you for a name and username, then generate an authorization token for your new bot.
- The name of your bot is displayed in contact details and elsewhere.
- The Username is a short name, to be used in mentions and telegram.me links. Usernames are 5-32 characters long and are case insensitive, but may only include Latin characters, numbers, and underscores. Your bot's username must end in ‘bot’.
- Copy the TOKEN to the file backup.sh as TELEGRAM_TOKEN
- Send a dummy message to your new bot
- Go to following url https://api.telegram.org/botTOKEN/getUpdates
- Look for
"chat":{"id":
- Copy the chatid to the file backup.sh as TELEGRAM_CHATID
TELEGRAM_TOKEN=""
curl https://api.telegram.org/bot$TELEGRAM_TOKEN/getUpdates | jq .result[0].message.chat.id
gpg --output private.pgp --armor --export-secret-key
gpg --batch --armor --export-secret-key