mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
remove file name from the message
This commit is contained in:
parent
0cf63c3aa0
commit
8520e44e61
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user