From 9bc2665db565189f35d745935771b1141253a6ec Mon Sep 17 00:00:00 2001
From: Pavel Vorobyov
Date: Wed, 10 Jun 2020 11:00:07 +0300
Subject: [PATCH] icqbot logging
---
icqnotify.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/icqnotify.py b/icqnotify.py
index f05e663..a448cda 100755
--- a/icqnotify.py
+++ b/icqnotify.py
@@ -5,7 +5,7 @@ from bot.bot import Bot
ICQ_TOKEN = os.environ.get("ICQ_TOKEN")
ICQ_CHAT_ID = os.environ.get("ICQ_CHAT_ID")
-ICQ_API_URL = os.environ.get("ICQ_API_URL", "api.icq.net")
+ICQ_API_URL = os.environ.get("ICQ_API_URL", "https://api.icq.net/bot/v1")
def send(message):
if not ICQ_TOKEN:
@@ -15,8 +15,10 @@ def send(message):
if not message:
raise ValueError("message is empty")
- bot = Bot(token=ICQ_TOKEN)
- bot.send_text(chat_id=ICQ_CHAT_ID, text=message)
+ print("using api base %s" % ICQ_API_URL)
+ bot = Bot(token=ICQ_TOKEN, api_url_base=ICQ_API_URL)
+ r = bot.send_text(chat_id=ICQ_CHAT_ID, text=message)
+ print("response was:", r)
if __name__ == '__main__':