Update max upload limit to new discord api limit

This commit is contained in:
Toastie 2025-02-04 21:23:12 +13:00
parent 3a602db94f
commit 05d44e19aa
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7

View file

@ -17,6 +17,8 @@ public class CloseCommand
private static Dictionary<ulong, string> closeReasons = new Dictionary<ulong, string>();
private static List<ulong> currentlyClosingTickets = new List<ulong>();
private const int MAX_UPLOAD_SIZE = 10 * 1024 * 1024;
[RequireGuild]
[Command("close")]
[Description("Closes this ticket.")]
@ -115,12 +117,14 @@ public class CloseCommand
try
{
FileInfo fileInfo = new FileInfo(filePath);
if (!fileInfo.Exists || fileInfo.Length >= 26214400)
if (!fileInfo.Exists || fileInfo.Length >= MAX_UPLOAD_SIZE)
{
fileName = Transcriber.GetHTMLFilename(ticket.id);
filePath = Transcriber.GetHtmlPath(ticket.id);
Logger.Debug("Transcript archive too large, sending only html instead.");
}
zipSize = fileInfo.Length;
Logger.Debug("Transcript zip size: " + zipSize + " bytes.");
}
catch (Exception e)
{
@ -166,7 +170,7 @@ public class CloseCommand
DiscordMessageBuilder message = new();
if (zipSize >= 26214400)
if (zipSize >= MAX_UPLOAD_SIZE)
{
message.AddEmbed(new DiscordEmbedBuilder
{