mirror of
https://github.com/unraid/webgui.git
synced 2026-04-22 01:40:58 -05:00
Merge pull request #512 from realies/patch-6
enable group chat IDs, update helper description
This commit is contained in:
@@ -215,9 +215,10 @@
|
||||
<Variables>
|
||||
<Variable Help="[a href='https://telegram.me/botfather' target='_blank'][u]BotFather[/u][/a] is the one bot to rule them all.[br][br]
|
||||
1. Make a bot using BotFather[br]
|
||||
2. Paste bot token in this field[br]
|
||||
3. Select bot via Telegram and press /start[br]
|
||||
4. Test bot (first test will be slow)[/a]" Desc="Bot Access Token" Default="">BOT_TOKEN</Variable>
|
||||
2. Paste the bot token in this field[br]
|
||||
3. Message the bot via Telegram (either via a direct message or a message via a group)[br]
|
||||
4. Test the bot[br][br]
|
||||
* To reset the notifications receiving user or group, run [i]rm /boot/config/plugins/dynamix/telegram/chatid[/i] in the terminal and re-run steps 3. and 4.[/a]" Desc="Bot Access Token" Default="">BOT_TOKEN</Variable>
|
||||
<Variable Help="Specify the fields which are included in the title of the notification." Desc="Notification Title" Default="$SUBJECT">TITLE</Variable>
|
||||
<Variable Help="Specify the fields which are included in the message body of the notification." Desc="Notification Message" Default="$DESCRIPTION">MESSAGE</Variable>
|
||||
</Variables>
|
||||
@@ -242,7 +243,7 @@
|
||||
if [[ ! -f $TELEGRAM/chatid || "$STORED_TOKEN" != "$BOT_TOKEN" ]]; then
|
||||
mkdir -p $TELEGRAM;
|
||||
LASTCHATID=$(curl -s https://api.telegram.org/bot$BOT_TOKEN/getUpdates | jq ".result | last .message .chat .id");
|
||||
[[ $LASTCHATID =~ ^[0-9]+$ ]] && echo $LASTCHATID > $TELEGRAM/chatid || exit 1
|
||||
[[ $LASTCHATID =~ ^-*[0-9]+$ ]] && echo $LASTCHATID > $TELEGRAM/chatid || exit 1
|
||||
fi
|
||||
|
||||
CHATID=$(< $TELEGRAM/chatid);
|
||||
|
||||
Reference in New Issue
Block a user