mirror of
https://github.com/diamondburned/cchat-discord.git
synced 2025-01-20 09:26:45 +00:00
Fix buggy message references
This commit is contained in:
parent
cc2b2ee4c7
commit
71c3069fa4
|
@ -284,11 +284,12 @@ func newRegularContent(m discord.Message, s *state.Instance) Message {
|
||||||
var content text.Rich
|
var content text.Rich
|
||||||
|
|
||||||
if m.ReferencedMessage != nil {
|
if m.ReferencedMessage != nil {
|
||||||
|
content.Content = "> "
|
||||||
refContent := []byte(m.ReferencedMessage.Content)
|
refContent := []byte(m.ReferencedMessage.Content)
|
||||||
segments.ParseWithMessageRich(&content, refContent, &m, s.Cabinet)
|
segments.ParseWithMessageRich(&content, refContent, &m, s.Cabinet)
|
||||||
|
|
||||||
content = segments.Ellipsize(content, 100)
|
content = segments.Ellipsize(content, 100)
|
||||||
content.Content = ">" + content.Content + "\n"
|
content.Content += "\n"
|
||||||
|
|
||||||
segutil.Add(&content,
|
segutil.Add(&content,
|
||||||
reference.NewMessageSegment(0, len(content.Content)-1, m.ReferencedMessage.ID),
|
reference.NewMessageSegment(0, len(content.Content)-1, m.ReferencedMessage.ID),
|
||||||
|
|
Loading…
Reference in a new issue