Skip to content

Commit 0214fad

Browse files
committed
Trim changelog for discord webhook
1 parent 42a9e15 commit 0214fad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

stonecutter.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,14 @@ publishMods {
137137
username = "Controlify Updates"
138138
avatarUrl = "https://raw.githubusercontent.com/isXander/Controlify/1.20.x/dev/src/main/resources/icon.png"
139139

140-
content = changelog.get() + "\n\n<@&1146064258652712960>" // <@Controlify Ping>
140+
var discordChangelog = changelog.get()
141+
val controlifyPing = "\n\n<@&1146064258652712960>" // <@Controlify Ping>
142+
if ((discordChangelog.length + controlifyPing.length) > 2000) {
143+
println("Changelog is too long for Discord, trimming.")
144+
discordChangelog = discordChangelog.substring(0, 2000 - controlifyPing.length - 3) + "..."
145+
}
146+
147+
content = "$discordChangelog\n\n<@&1146064258652712960>" // <@Controlify Ping>
141148

142149
// publishResults.from(
143150
// *versionProjects

0 commit comments

Comments
 (0)