Add an option that allows resulting content to be oversized, and fallback to processing the result as a file if it is too large - similar to the behaviour of all /debug * commands (chat, user and message).
/code * ... {option}: boolean
disable_trim = false
trim_content = true
|
while (content.length > 2000) { |
|
amendNotes.add('Requested content was trimmed.'); |
|
const lines = content.split('\n'); |
|
|
|
// #region trim location |
|
if (subCommand === 'entity' && trimTopThisTime) { |
|
lines.splice(notesCount + 2, 1); |
|
actualStart++; |
|
} else { |
|
lines.splice(-2, 1); |
|
actualEnd--; |
|
} |
|
trimTopThisTime = !trimTopThisTime; |
|
// #endregion |
|
|
|
// #region notes re-injection |
|
if (amendNotes.size !== notesCount) { |
|
const notesLines = [...amendNotes].map((note) => `> ${note}`); |
|
lines.splice(1, notesCount, ...notesLines); |
|
notesCount = amendNotes.size; |
|
} |
|
// #endregion |
|
|
|
lines[0] = this.generateContentHeader(file, [startLine, actualStart], [endLine, actualEnd]); |
|
content = lines.join('\n'); |
|
} |
It is worth noting that Discord stable doesn't appear to have the file preview which its siblings have had for some time.
Add an option that allows resulting content to be oversized, and fallback to processing the result as a file if it is too large - similar to the behaviour of all
/debug *commands (chat, user and message)./code * ... {option}: booleandisable_trim = falsetrim_content = truedocs-bot/src/commands/code.ts
Lines 208 to 233 in 9bafefb
It is worth noting that Discord stable doesn't appear to have the file preview which its siblings have had for some time.