update docker/bot/jd_bot.

修正 /cmd 指令超长的生成日志名异常的问题
This commit is contained in:
iouAkira
2021-03-23 15:46:06 +08:00
committed by Gitee
parent e7d915fa28
commit 5f0bc7a64c

View File

@@ -733,8 +733,7 @@ def shcmd(update, context):
helpers.escape_markdown(' ↓↓↓ %s 执行结果超长,请查看log ↓↓↓' % cmd)),
chat_id=update.effective_chat.id,
parse_mode=ParseMode.MARKDOWN_V2)
log_name = '%sbot_%s_%s.log' % (
_logs_dir, 'git', os.path.splitext(commands[-1])[0])
log_name = '%sbot_%s_%s.log' % (_logs_dir, 'cmd', commands[0])
with open(log_name, 'a+') as wf:
wf.write(out_text)
msg.reply_document(