From e099fdafd95045ae3a6147dbee535ca79f9556d5 Mon Sep 17 00:00:00 2001 From: Bohdan Turkynewych Date: Wed, 26 Jul 2023 01:11:42 +0300 Subject: [PATCH] Fix cfg --- mesh.ini.example | 2 +- mtg/bot/telegram/telegram.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mesh.ini.example b/mesh.ini.example index ea6a982..9aba5d6 100644 --- a/mesh.ini.example +++ b/mesh.ini.example @@ -78,7 +78,7 @@ AirRaidPrivate = aaabbbccc # en: Externally accessible web app URL ExternalURL = https://example.com/ # en: Shortener service to use: pls, tly. Long URL by default -ShortenerService = 'pls' +ShortenerService = pls TLYToken = aaabbb PLSST = aaabbbb diff --git a/mtg/bot/telegram/telegram.py b/mtg/bot/telegram/telegram.py index 6a029cc..b167bc0 100644 --- a/mtg/bot/telegram/telegram.py +++ b/mtg/bot/telegram/telegram.py @@ -161,9 +161,9 @@ def echo(self, update: Update, _) -> None: file_path = os.path.basename(urlparse(photo_file.file_path).path) photo_file.download(f'./web/static/t/{file_path}') long_url = f'{self.config.WebApp.ExternalURL}/static/t/{file_path}' - if self.config.WebApp.Shortener == 'pls': + if self.config.WebApp.ShortenerService == 'pls': short_url = self.shorten_pls(long_url) - elif self.config.WebApp.Shortener == 'tly': + elif self.config.WebApp.ShortenerService == 'tly': short_url = self.shorten_tly(long_url) else: short_url = long_url