Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
fix #16 暫定対応としてEmbedsの制限を超えるメッセージは丸めるように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yogarasu committed Aug 23, 2022
1 parent 2916c63 commit b8f30a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libs/message.mts
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,16 @@ export class MessageClient {

// Whether message has attached file only
if (message.content) {
// FIXME: As an interim workaround, Embed cannot save message longer than 1024 characters and will truncate them
const content =
message.content.length > 1024
? message.content.substring(0, 1021) + "..."
: message.content

const fields: Embed["fields"] = [
{
name: "------------------------------------------------",
value: message.content,
value: content,
},
]

Expand Down

0 comments on commit b8f30a4

Please sign in to comment.