debugging
This commit is contained in:
@@ -166,18 +166,18 @@ class XMPPTelegram(ComponentXMPP):
|
||||
|
||||
# detect media
|
||||
|
||||
if "oob" in iq:
|
||||
logging.debug("Found OOB content in message")
|
||||
if "url" in iq['oob']:
|
||||
url = iq['oob']['url']
|
||||
logging.debug("Found OOB URL: {}".format(url))
|
||||
if url.split('.')[-1] in self.config['media_external_formats']:
|
||||
logging.debug("Media found")
|
||||
media = InputMediaPhotoExternal(url, "Image")
|
||||
try:
|
||||
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.')
|
||||
try:
|
||||
url = iq['oob']['url']
|
||||
logging.debug("Found OOB URL: {}".format(url))
|
||||
if url.split('.')[-1] in self.config['media_external_formats']:
|
||||
logging.debug("Media found")
|
||||
media = InputMediaPhotoExternal(url, "Image")
|
||||
try:
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user