diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-01-04 01:59:27 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-01-04 01:59:27 +0300 |
commit | a03ec7111827c4574225c9d300d9968f78c84886 (patch) | |
tree | 44bf56e1f1b8a336ac85faecd2aae82619de7adb /src/home/telegram/bot.py | |
parent | 36791ffcea24f72e91d70703fc4f8b16606f2ab6 (diff) |
polaris_kettle_bot: use new bot framework
Diffstat (limited to 'src/home/telegram/bot.py')
-rw-r--r-- | src/home/telegram/bot.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/home/telegram/bot.py b/src/home/telegram/bot.py index 3bdb01a..10bfe06 100644 --- a/src/home/telegram/bot.py +++ b/src/home/telegram/bot.py @@ -133,10 +133,12 @@ def handler(**kwargs): if 'text' in kwargs: texts.append(kwargs['text']) if 'texts' in kwargs: - texts.append(kwargs['texts']) + texts += kwargs['texts'] - if messages: - texts = list(itertools.chain.from_iterable([lang.all(m) for m in messages])) + if messages or texts: + new_messages = list(itertools.chain.from_iterable([lang.all(m) for m in messages])) + texts += new_messages + texts = list(set(texts)) _updater.dispatcher.add_handler( MessageHandler(text_filter(*texts), _handler), group=0 |