From 88f416b78a0ee40617c39a2ecb6a5486190e1efa Mon Sep 17 00:00:00 2001 From: "un.def" Date: Mon, 17 Jun 2019 16:20:32 +0300 Subject: [PATCH] Update tg bot messages --- app/views/webhook.lua | 5 ++++- templates/bot/ok-help.txt | 2 ++ templates/bot/ok-links.txt | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/webhook.lua b/app/views/webhook.lua index 4cae199..c00dbee 100644 --- a/app/views/webhook.lua +++ b/app/views/webhook.lua @@ -23,6 +23,7 @@ local tg_bot_username = config.tg.bot_username local tg_webhook_secret = config.tg.webhook_secret or tg_token local hide_image_download_link = config.hide_image_download_link +local link_url_prefix = helpers.link_url_prefix local render_link_factory = helpers.render_link_factory local render_to_string = helpers.render_to_string @@ -75,7 +76,9 @@ return { if is_groupchat and bot_username ~= tg_bot_username then exit(ngx.HTTP_OK) end - send_webhook_response(message, 'bot/ok-help.txt') + send_webhook_response(message, 'bot/ok-help.txt', { + link_url_prefix = link_url_prefix, + }) end -- tricky way to ignore groupchat service messages (e.g., new_chat_member) diff --git a/templates/bot/ok-help.txt b/templates/bot/ok-help.txt index 5a13bb3..817e94b 100644 --- a/templates/bot/ok-help.txt +++ b/templates/bot/ok-help.txt @@ -3,4 +3,6 @@ Send me any content, and I'll generate public HTTP link for it. {( includes/supported_types.txt )} +You can also upload any [file]({* link_url_prefix *}/upload) or [text]({* link_url_prefix *}/upload/text) directly with your browser. + {( includes/max_file_size.txt )} diff --git a/templates/bot/ok-links.txt b/templates/bot/ok-links.txt index 52f04e1..726ea21 100644 --- a/templates/bot/ok-links.txt +++ b/templates/bot/ok-links.txt @@ -1,11 +1,11 @@ {( includes/user_mention.txt )} -*Direct inline link (view in browser)*: +*Inline link (view in browser)*: {* render_link(modes.INLINE) *}{* extension *} {% if not hide_download_link then %} -*Direct download link*: +*Download link*: {* render_link(modes.DOWNLOAD) *}{* extension *} {% end %} -*All links and preview page*: +*Links page*: {* render_link(modes.LINKS) *}