mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Fix various bugs and regressions
This commit is contained in:
parent
8785354a2b
commit
80c572f594
11 changed files with 60 additions and 57 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using NodaTime;
|
||||
|
|
@ -70,6 +71,7 @@ namespace PluralKit.Bot
|
|||
embedTitle,
|
||||
async (builder, switches) =>
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var entry in switches)
|
||||
{
|
||||
var lastSw = entry.LastTime;
|
||||
|
|
@ -98,17 +100,13 @@ namespace PluralKit.Bot
|
|||
stringToAdd =
|
||||
$"**{membersStr}** ({sw.Timestamp.FormatZoned(system.Zone)}, {switchSince.FormatDuration()} ago)\n";
|
||||
}
|
||||
|
||||
try // Unfortunately the only way to test DiscordEmbedBuilder.Description max length is this
|
||||
{
|
||||
// TODO: what is this??
|
||||
// builder.Description += stringToAdd;
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
|
||||
if (sb.Length + stringToAdd.Length >= 1024)
|
||||
break;
|
||||
}// TODO: Make sure this works
|
||||
sb.Append(stringToAdd);
|
||||
}
|
||||
|
||||
builder.Description(sb.ToString());
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue