-
Notifications
You must be signed in to change notification settings - Fork 53
๐ญ Telegram notifications
coccoinomane edited this page May 14, 2022
·
1 revision
The bot can send notifications to your phone on successful and unsuccessful commands (e.g. sendTeamsMining
, reinforceDefense
, reinforceAttack
, etc).
Follow these instructions for setup:
- Open Telegram.
- Enter
@Botfather
in the search tab and choose this bot. - Choose or type the
/start
command and send it. - Choose or type the
/newbot
command and send it. And follow Botfather's instructions. - Take a note of your token value e.g.
11112222:AAASBBBSDASD
. This is yourTELEGRAM_API_KEY
. And keep this private! - Enter
@your-newly-created-bot-name
in the search tab and choose this bot. - Choose or type the
/start
command and send it. - Enter
@username_to_id_bot
in the search tab and choose this bot. - Choose or type the
/start
command and send it. - Take a note of your ID e.g.
P.S. Your ID: 1122334455
. This is yourTELEGRAM_CHAT_ID
.
Then, set your .env file:
- set
NOTIFICATION_IM=1
andTELEGRAM_ENABLE=1
- set
TELEGRAM_API_KEY
andTELEGRAM_CHAT_ID
- run
python3 -m src.tests.testSendIM
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 the bot with the chat ID of the chat group.
- Thanks to @yigitest for the first implentation of the TG notifications ๐ช
- Thanks to @nikohd12 for the chat group trick