mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-26 04:51:09 -05:00
Update plugin.py
This commit is contained in:
parent
d8dccfa83c
commit
5acca16e80
@ -70,7 +70,7 @@ class Azure(callbacks.Plugin):
|
|||||||
response = requests.post(url, headers=headers, json=body)
|
response = requests.post(url, headers=headers, json=body)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
result = response.json()
|
result = response.json()
|
||||||
if result[0]['detectedLanguage']:
|
if result[0].get('detectedLanguage'):
|
||||||
reply = "{0} [{1}~>{2}]".format(result[0]['translations'][0]['text'], result[0]['detectedLanguage']['language'], target)
|
reply = "{0} [{1}~>{2}]".format(result[0]['translations'][0]['text'], result[0]['detectedLanguage']['language'], target)
|
||||||
else:
|
else:
|
||||||
reply = "{0} [{1}~>{2}]".format(source, target)
|
reply = "{0} [{1}~>{2}]".format(source, target)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user