-
Notifications
You must be signed in to change notification settings - Fork 4
π Telegram alerts
coccoinomane edited this page Jun 14, 2023
·
3 revisions
Use w3 subscribe --tg
to receive Telegram alerts every time something happens on the blockchain. But, first, you need to create a Telegram bot.
- Open Telegram and enter
@Botfather
in the search tab, then select the Botfather bot. - Click on START, then type
/newbot
. You will need to choose a name and a username for your bot. - Take note of your token value and store it in web3cli:
w3 config set telegram_api_key 11112222:AAASBBBSDASD
. Do not share your token with anybody! - Enter
@your_newly_created_bot_username
in the search tab and select your bot. Then click on START to subscribe to the bot.
- First, you need to find your Telegram user ID. To do so, enter
@username_to_id_bot
in the search tab and select the IDBot. - Click on START. The IDBot will print your ID. Take note of it and save it in web3cli:
w3 config set telegram_chat_id 1234567890
. - Run
w3 debug telegram
to send a test message.
If everything worked fine, you should receive a Telegram message on your newly created bot.
To send Telegram notifications to more than one user, using same bot:
- Create a group chat with the other person.
- Add the bot to that chat group.
- Configure web3cli with the chat ID of the chat group:
w3 config set telegram_chat_id 1234567890
- Thanks to @yigitest for the first implentation of the TG notifications in Crabada.py πͺ
- Thanks to @nikohd12 for the chat group trick