starboard: Only trim when message is too long

master
Luther Wen Xu 2019-11-20 17:34:56 +07:00
parent ea84d81e0b
commit 48b6994dc9
Signed by: chanbakjsd
GPG Key ID: B7D77E3E9D102B70
1 changed files with 4 additions and 1 deletions

@ -57,7 +57,10 @@ func listenToStarboardReact(s *discordgo.Session, m *discordgo.MessageReactionAd
color = 0xFFFFFF color = 0xFFFFFF
} }
content := msg.Content[:1000] content := msg.Content
if len(content) > 1000 {
content = content[:1000]
}
//Up to 10 line //Up to 10 line
splittedContent := strings.SplitN(content, "\n", 11) splittedContent := strings.SplitN(content, "\n", 11)
content = strings.Join(splittedContent[:10], "\n") content = strings.Join(splittedContent[:10], "\n")