From 984edefb843ba4f0130d28a351218c3fa3b10e7e Mon Sep 17 00:00:00 2001 From: icovada Date: Mon, 22 Aug 2016 19:17:36 +0200 Subject: [PATCH 1/3] Update Telegram notify Add documentation for Document file format as per pull request 2937 on main project --- source/_components/notify.telegram.markdown | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/_components/notify.telegram.markdown b/source/_components/notify.telegram.markdown index 07455bd989d..ff6ae938e5b 100644 --- a/source/_components/notify.telegram.markdown +++ b/source/_components/notify.telegram.markdown @@ -92,6 +92,31 @@ action: - **username** (*Optional*): Username for an URL which require HTTP basic authentication. - **password** (*Optional*): Username for an URL which require HTTP basic authentication. +### {% linkable_title Document support %} + +```yaml +... +action: + service: notify.NOTIFIER_NAME + data: + title: Send a document + message: That's a example that sends a document. + data: + document: + - url: http://192.168.1.28/bounce.gif + username: admin + password: secrete + - file: /tmp/whatever.odf + caption: Picture Title xy + - url: http://somebla.ie/video.mp4 + caption: I.e. for a Title +``` + +- **url** or **file** (*Required*): For local or remote path to an image. +- **caption** (*Optional*): The title of the image. +- **username** (*Optional*): Username for an URL which require HTTP basic authentication. +- **password** (*Optional*): Username for an URL which require HTTP basic authentication. + ### {% linkable_title Location support %} ```yaml From ef00d7557e982decf4063666cdc7db074be9896d Mon Sep 17 00:00:00 2001 From: icovada Date: Tue, 23 Aug 2016 18:40:58 +0200 Subject: [PATCH 2/3] Fixed documentation due to proposed change --- source/_components/notify.telegram.markdown | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/_components/notify.telegram.markdown b/source/_components/notify.telegram.markdown index ff6ae938e5b..e508a9be505 100644 --- a/source/_components/notify.telegram.markdown +++ b/source/_components/notify.telegram.markdown @@ -103,13 +103,9 @@ action: message: That's a example that sends a document. data: document: - - url: http://192.168.1.28/bounce.gif - username: admin - password: secrete - - file: /tmp/whatever.odf - caption: Picture Title xy - - url: http://somebla.ie/video.mp4 - caption: I.e. for a Title + file: /tmp/whatever.odf + caption: Picture Title xy + ``` - **url** or **file** (*Required*): For local or remote path to an image. From 102e1ed70001e04b594a06a6c228a861e798ea0f Mon Sep 17 00:00:00 2001 From: icovada Date: Sat, 27 Aug 2016 13:43:19 +0200 Subject: [PATCH 3/3] Fixed open parenthesis As suggested by @Landrash --- source/_components/notify.telegram.markdown | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/source/_components/notify.telegram.markdown b/source/_components/notify.telegram.markdown index e508a9be505..4044f9ff3f1 100644 --- a/source/_components/notify.telegram.markdown +++ b/source/_components/notify.telegram.markdown @@ -25,17 +25,8 @@ The quickest way to retrieve your `chat_id` is visiting [https://api.telegram.or The result set will include your chat ID as `id` in the `from` section: ```json -{ - "ok":true, - "result":[ - { - "update_id":254199982, - "message":{ - "message_id":201, - "from":{ - "id":123456789, - "first_name":"Your first name", -... +{"ok":true,"result":[{"update_id":254199982, +"message":{"message_id":27,"from":{"id":123456789,"first_name":"YOUR_FIRST_NAME YOUR_NICK_NAME","last_name":"YOUR_LAST_NAME","username":"YOUR_NICK_NAME"},"chat":{"id":123456789,"first_name":"YOUR_FIRST_NAME YOUR_NICK_NAME","last_name":"YOUR_LAST_NAME","username":"YOUR_NICK_NAME","type":"private"},"date":1678292650,"text":"test"}}]} ``` Another way to get your chat ID directly is described below: