🐛 fix: tg apikey command missing sk prefix (#76)

This commit is contained in:
Buer 2024-02-26 19:06:47 +08:00 committed by GitHub
parent 6b8ba36213
commit 1ae0baa8cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,9 +63,10 @@ func getApikeyList(userId, page int) (message string, pageParams *paginationPara
message = "点击令牌可复制:\n"
for _, token := range *list.Data {
message += fmt.Sprintf("*%s* : `%s`\n", escapeText(token.Name, "MarkdownV2"), token.Key)
key := "sk-" + token.Key
message += fmt.Sprintf("*%s* : `%s`\n", escapeText(token.Name, "MarkdownV2"), key)
if chatUrlTmp != "" {
message += strings.ReplaceAll(chatUrlTmp, `setToken`, token.Key)
message += strings.ReplaceAll(chatUrlTmp, `setToken`, key)
}
message += "\n"
}