mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: 过长消息(多于4000)被slack夹断切分的问题
This commit is contained in:
parent
fd06f8c21a
commit
40b72989e4
3 changed files with 12 additions and 2 deletions
|
|
@ -422,11 +422,15 @@ export async function isCN () {
|
|||
}
|
||||
}
|
||||
|
||||
export function limitString (str, maxLength) {
|
||||
export function limitString (str, maxLength, addDots = true) {
|
||||
if (str.length <= maxLength) {
|
||||
return str
|
||||
} else {
|
||||
return str.slice(0, maxLength) + '...'
|
||||
if (addDots) {
|
||||
return str.slice(0, maxLength) + '...'
|
||||
} else {
|
||||
return str.slice(0, maxLength)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue