From bbf3b3a638e7371af38c8c3c2dd5b643ecccf0bb Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 1 Feb 2020 19:15:55 +0800 Subject: [PATCH] test --- job.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/job.go b/job.go index e5da200..0ee23c7 100644 --- a/job.go +++ b/job.go @@ -1243,7 +1243,7 @@ func jobVaultItemStatus(j Job) { chat, err := bot.ChatByID(strconv.FormatInt(userId, 10)) logOnError(err, "jobVaultItemStatus : ChatByID") if err == nil { - out = fmt.Sprintf("%s%-32d |%6d |%6d |%6d\n", out, chat.Username, depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) + out = fmt.Sprintf("%s%-32s |%6d |%6d |%6d\n", out, chat.Username, depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) } else { out = fmt.Sprintf("%s%-32d |%6d |%6d |%6d\n", out, userId, depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) } @@ -1273,7 +1273,13 @@ func jobVaultItemStatus(j Job) { out := fmt.Sprintf("%-32s | Depo. | Recv. | Total\n────────────────────────────┼──────┼──────┼──────\n", `User`) for i, userId := range userList { logOnError(err, "jobVaultItemStatus : getObjItem") - out = fmt.Sprintf("%s%-32d |%6d |%6d |%6d\n", out, userId, depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) + chat, err := bot.ChatByID(strconv.FormatInt(userId, 10)) + logOnError(err, "jobVaultItemStatus : ChatByID") + if err == nil { + out = fmt.Sprintf("%s%-32s |%6d |%6d |%6d\n", out, chat.Username, depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) + } else { + out = fmt.Sprintf("%s%-32d |%6d |%6d |%6d\n", out, userId, depositList[i], withdrawList[i], depositList[i]-withdrawList[i]) + } } out = fmt.Sprintf("%s", out)