debugging

This commit is contained in:
2019-03-10 17:29:57 +01:00
parent 57b4a680f0
commit 33553d9db0

View File

@@ -166,9 +166,7 @@ class XMPPTelegram(ComponentXMPP):
# detect media
if "oob" in iq:
logging.debug("Found OOB content in message")
if "url" in iq['oob']:
try:
url = iq['oob']['url']
logging.debug("Found OOB URL: {}".format(url))
if url.split('.')[-1] in self.config['media_external_formats']:
@@ -178,6 +176,8 @@ class XMPPTelegram(ComponentXMPP):
result = self.tg_connections[jid].invoke(SendMediaRequest(tg_peer, media, "Image", random_id = generate_random_long(), reply_to_msg_id = reply_mid))
except Exception:
print('Media upload failed.')
except KeyError:
logging.debug("No OOB found")
# media send failed. #
if not result: