From 9629492ffb64832d80e24f7e804b4a84a71b9d94 Mon Sep 17 00:00:00 2001 From: Maki Date: Mon, 22 Jun 2020 09:15:59 -0700 Subject: [PATCH 1/4] Update en.yml --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index fbe96d8..3a8ccb3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -49,7 +49,7 @@ en: telegram: webhook: start: - need_token: 'To be able to link your Lumi and Telegram accounts, you can go to Lumi and find a link to Telegram. Once you open it I can link them P)' + need_token: 'To link your Lumi and Telegram accounts, click here: %{token_link}' couldnt_find: "I couldn't find you, did you use the correct link?" hi: "Hi %{pirata}! I linked your accounts, from now on I'll contact you whenever there's news" message: From dadd6cb79e805a38e63973e1d644be37f8bede0e Mon Sep 17 00:00:00 2001 From: Maki Date: Mon, 22 Jun 2020 09:16:07 -0700 Subject: [PATCH 2/4] Update es.yml --- config/locales/es.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/es.yml b/config/locales/es.yml index 53575bb..b82d8c3 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -55,7 +55,7 @@ es: telegram: webhook: start: - need_token: 'Para poder asociar tus cuentas entre Lumi y Telegram, podés ir a Lumi y buscar el vínculo a Telegram. Al abrirlo se asocian las cuentas P)' + need_token: 'Para poder asociar tus cuentas entre Lumi y Telegram, seguí este link: %{token_link}' couldnt_find: 'No te encuentro, ¿usaste el vínculo correcto?' hi: '¡Hola %{pirata}! Ya asocié tus cuentas de Lumi y Telegram, a partir de ahora te voy a contactar con las actualizaciones P)' message: From 0d9afe8b6660962f04995bf396826bf8d31bbc5a Mon Sep 17 00:00:00 2001 From: Maki Date: Mon, 22 Jun 2020 09:17:09 -0700 Subject: [PATCH 3/4] Devuelve url para vincular lumi con telegram --- app/controllers/telegram/webhook_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/telegram/webhook_controller.rb b/app/controllers/telegram/webhook_controller.rb index f200659..b30753e 100644 --- a/app/controllers/telegram/webhook_controller.rb +++ b/app/controllers/telegram/webhook_controller.rb @@ -15,7 +15,7 @@ module Telegram # Recibe un token, lo busca y asocia las cuentas def start!(token = nil) unless token - respond_with :message, text: t('.need_token') + respond_with :message, text: t('.need_token', token_link: vincular_a_telegram_url) return end @@ -28,5 +28,9 @@ module Telegram respond_with :message, text: t('.hi', pirata: pirata.nick) end + private + def vincular_a_telegram_url + 'https://#{ENV.fetch('APP_HOST', 'lumi.partidopirata.com.ar')}/#/vincularATelegram' + end end end From e136b6c6f44226bbe3296d04e4ff22e3be0d5c31 Mon Sep 17 00:00:00 2001 From: Maki Date: Mon, 22 Jun 2020 09:25:30 -0700 Subject: [PATCH 4/4] Update env.example --- env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/env.example b/env.example index 97660c4..a2810f9 100644 --- a/env.example +++ b/env.example @@ -4,6 +4,7 @@ PORT=3000 RAILS_ENV="development" WEB_CONCURRENCY=2 API_HOST="api.lumi.partidopirata.com.ar" +APP_HOST="lumi.partidopirata.com.ar" RAILS_MASTER_KEY= RAILS_SERVE_STATIC_FILES=true RAILS_LOG_TO_STDOUT=true