Fix Build Errors

This commit is contained in:
Fennel
2020-04-24 15:50:28 -04:00
committed by Astrid
parent 23cf06df4c
commit c99784b9dc
19 changed files with 301 additions and 136 deletions

View File

@@ -1,7 +1,8 @@
using System.Linq;
using ArgumentException = System.ArgumentException;
using System.Linq;
using System.Threading.Tasks;
using Discord;
using DSharpPlus.Entities;
using NodaTime;
@@ -88,9 +89,14 @@ namespace PluralKit.Bot
stringToAdd =
$"**{membersStr}** ({DateTimeFormats.ZonedDateTimeFormat.Format(sw.Timestamp.InZone(system.Zone))}, {DateTimeFormats.DurationFormat.Format(switchSince)} ago)\n";
}
if (outputStr.Length + stringToAdd.Length > EmbedBuilder.MaxDescriptionLength) break;
outputStr += stringToAdd;
try // Unfortunately the only way to test DiscordEmbedBuilder.Description max length is this
{
builder.Description += stringToAdd;
}
catch (ArgumentException)
{
break;
}// TODO: Make sure this works
}
builder.Description = outputStr;