remove file name from the message

This commit is contained in:
Rafael Ameijeiras 2021-07-13 13:38:09 +02:00
parent 0cf63c3aa0
commit 8520e44e61
1 changed files with 3 additions and 3 deletions

View File

@ -132,6 +132,8 @@ def sendMedia(mssg, chatId, token, filepath):
print(r) print(r)
# Parse api config # Parse api config
filecap=None
if args.api_conf : if args.api_conf :
api = parse_api_conf(args.api_conf) api = parse_api_conf(args.api_conf)
# Parse graph config # Parse graph config
@ -155,14 +157,12 @@ if args.api_conf :
if filename is not None: if filename is not None:
filecap=f"graph_{graph_cfg['module_id']}.{datetime.now().strftime('%s')}.png" filecap=f"graph_{graph_cfg['module_id']}.{datetime.now().strftime('%s')}.png"
else:
filecap=None
# Send message # Send message
send(mssg=args.message, chatId=args.chat_id, token=args.token) send(mssg=args.message, chatId=args.chat_id, token=args.token)
if filecap is not None: if filecap is not None:
sendMedia(mssg=filecap, chatId=args.chat_id, token=args.token, filepath=filename) sendMedia(mssg='', chatId=args.chat_id, token=args.token, filepath=filename)
try: try:
os.remove(filename) os.remove(filename)
except Exception as e: except Exception as e: