mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-04 10:14:31 +02:00
mod/notification-telegram: introduce $GetTelegramChatId
This commit is contained in:
parent
4eafcaa3ac
commit
53b13b295a
5 changed files with 52 additions and 9 deletions
BIN
doc/mod/notification-telegram.d/getchatid.avif
Normal file
BIN
doc/mod/notification-telegram.d/getchatid.avif
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
|
@ -38,14 +38,21 @@ create your own bot:
|
|||
|
||||

|
||||
|
||||
Now open a chat with your bot and start it by clicking the `START` button.
|
||||
Set that token from *BotFather* (use your own!) to `TelegramTokenId`, for
|
||||
now just temporarily:
|
||||
|
||||
Open just another chat with [GetIDs Bot](https://t.me/getidsbot), again start
|
||||
with the `START` button. It will send you some information, including the
|
||||
`id`, just below `You`.
|
||||
:set TelegramTokenId "5214364459:AAHLwf1o7ybbKDo6pY24Kd2bZ5rjCakDXTc";
|
||||
|
||||
Now open a chat with your bot and start it by clicking the `START` button,
|
||||
then send your first message. Any text will do. On your device run
|
||||
`$GetTelegramChatId` to retrieve the chat id:
|
||||
|
||||
$GetTelegramChatId;
|
||||
|
||||

|
||||
|
||||
Finally edit `global-config-overlay`, add `TelegramTokenId` with the token
|
||||
from *BotFather* and `TelegramChatId` with your id from *GetIDs Bot*. Then
|
||||
from *BotFather* and `TelegramChatId` with your retrieved chat id. Then
|
||||
reload the configuration.
|
||||
|
||||
> ℹ️ **Info**: Copy relevant configuration from
|
||||
|
@ -54,9 +61,10 @@ reload the configuration.
|
|||
|
||||
### Notifications to a group
|
||||
|
||||
Sending notifications to a group is possible as well. Add your bot and the
|
||||
*GetIDs Bot* to a group, then use the group's id (which starts with a dash)
|
||||
for `TelegramChatId`. Then remove *GetIDs Bot* from group.
|
||||
Sending notifications to a group is possible as well. Add your bot to a group
|
||||
and make it an admin (required for read access!) and send a message and run
|
||||
`$GetTelegramChatId` again. Then use that chat id (which starts with a dash)
|
||||
for `TelegramChatId`.
|
||||
|
||||
Groups can enable the `Topics` feature. Use `TelegramThreadId` to send to a
|
||||
specific topic in a group.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue