Skip to content

Commit 73a1482

Browse files
committed
fix: minus two forum bugs
1 parent 41d689e commit 73a1482

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

app/forumer/run.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ func (v *Forumer) update() {
166166
Value: string(new_post.LastUpdated),
167167
Inline: true,
168168
})
169-
content.WriteString(fmt.Sprintf("```%s```\n", new_post.PostContent[:600]))
169+
170+
var post_content string = string(new_post.PostContent)
171+
if len(post_content) >= 600 {
172+
post_content = post_content[:600]
173+
}
174+
content.WriteString(fmt.Sprintf("```%s```\n", post_content))
170175
embed.Description = content.String()
171176

172177
embed.Thumbnail = &discordgo.MessageEmbedThumbnail{URL: string(new_post.PostAuthorAvatarLink)}

app/viewer/channel.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ func (v ChannelView) DeleteOld() {
8686
continue
8787
}
8888

89+
// embeding msgs contain forumer emails
90+
if len(msg.Embeds) > 0 {
91+
continue
92+
}
93+
8994
if deleteLimit <= 0 {
9095
break
9196
}

0 commit comments

Comments
 (0)