diff options
| author | jantuomi <jans.tuomi@gmail.com> | 2016-07-18 16:01:58 +0300 |
|---|---|---|
| committer | jantuomi <jans.tuomi@gmail.com> | 2016-07-18 16:02:35 +0300 |
| commit | e5dede846917747e688a4b6581da019712ca9b1d (patch) | |
| tree | 3fa26f8f19077a4c2837693036be01c035ac0acf /botmanager.py | |
| parent | 2756b0b849d759001a34f89f29164feca9ad4568 (diff) | |
Add option to change API call interval
Diffstat (limited to 'botmanager.py')
| -rw-r--r-- | botmanager.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/botmanager.py b/botmanager.py index cd74f46..48fad3c 100644 --- a/botmanager.py +++ b/botmanager.py @@ -14,6 +14,7 @@ from shoutboxapicommunicator import Communicator class BotManager(object): shoutbox_api_url = "http://localhost:8000" telegram_chat_id = "default_id" + api_call_interval = 10 def __init__(self, token): self.token = token @@ -41,7 +42,7 @@ class BotManager(object): logging.info("Listening for messages...") while True: self.forward_to_telegram(Communicator.fetch(self.shoutbox_api_url)) - time.sleep(10) + time.sleep(self.api_call_interval) def forward_to_telegram(self, messages): try: |
