do not try to attach an empty file
This commit is contained in:
parent
44b7a85285
commit
a16b724583
|
@ -97,7 +97,7 @@ async def send_msg(client, msg, force_notify=False, file=None):
|
||||||
# Add the portal name.
|
# Add the portal name.
|
||||||
msg = "**{}**: {}".format(portal_name, msg)
|
msg = "**{}**: {}".format(portal_name, msg)
|
||||||
|
|
||||||
if isinstance(file, str):
|
if file and isinstance(file, str):
|
||||||
is_json = is_json_string(file)
|
is_json = is_json_string(file)
|
||||||
content_type = "application/json" if is_json else "text/plain"
|
content_type = "application/json" if is_json else "text/plain"
|
||||||
ext = "json" if is_json else "txt"
|
ext = "json" if is_json else "txt"
|
||||||
|
|
Reference in New Issue