summaryrefslogtreecommitdiff
path: root/src/home/telegram/bot.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-01-04 01:59:27 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-01-04 01:59:27 +0300
commita03ec7111827c4574225c9d300d9968f78c84886 (patch)
tree44bf56e1f1b8a336ac85faecd2aae82619de7adb /src/home/telegram/bot.py
parent36791ffcea24f72e91d70703fc4f8b16606f2ab6 (diff)
polaris_kettle_bot: use new bot framework
Diffstat (limited to 'src/home/telegram/bot.py')
-rw-r--r--src/home/telegram/bot.py8
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