Skip to content

Commit

Permalink
Merge pull request #67 from KazWolfe/buf-msg2
Browse files Browse the repository at this point in the history
fix: flush the final buffer
  • Loading branch information
philpax authored Jul 3, 2024
2 parents 525fd89 + 716c4cc commit 2046064
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Plogon/DiscordWebhook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,15 @@ public async Task SendSplitting(Color color, string message, string title, strin
{
if (buffer.Length + part.Length > 2000)
{
messages.Add(buffer);
messages.Add(buffer.Trim());
buffer = "";
}

buffer += part + "\n";
}

// flush final buffer
messages.Add(buffer.Trim());

foreach (var body in messages)
{
Expand Down

0 comments on commit 2046064

Please sign in to comment.