diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2016-07-28 15:12:00 -0400 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2016-07-28 15:12:00 -0400 |
| commit | bc99e19c4ccb7748cf010bd2318bb8a8941ec2ba (patch) | |
| tree | b601cc5203f9de4cd6afc0906a165e6f25d6903d /project/telegramapicommunicator.py | |
| parent | a4ef3b69b530f1d3e52efda921bbc840319e9e26 (diff) | |
Fix bug where messages are answered in a wrong Telegram chat
Diffstat (limited to 'project/telegramapicommunicator.py')
| -rw-r--r-- | project/telegramapicommunicator.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/project/telegramapicommunicator.py b/project/telegramapicommunicator.py index 7fdb29c..a4b6964 100644 --- a/project/telegramapicommunicator.py +++ b/project/telegramapicommunicator.py @@ -27,7 +27,10 @@ class TelegramCommunicator(BaseCommunicator): TelegramCommunicator.send_raw("{}: {}".format(data["user"], data["text"])) @staticmethod - def send_raw(message): + def send_raw(message, chat_id=None): + if chat_id is None: + chat_id = TelegramCommunicator.chat_id + try: TelegramCommunicator.bot.sendMessage(TelegramCommunicator.chat_id, message) |
