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 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: 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: 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