feat: add attachment file size support for messages and update upload limits

This commit is contained in:
HueByte
2026-02-21 20:37:13 +01:00
parent 35a162d013
commit bc8e2fd7da
11 changed files with 344 additions and 20 deletions
+3 -2
View File
@@ -6,8 +6,9 @@ public static class HubConstants
public const string DefaultChannel = "general";
public const int DefaultHistoryCount = 100;
public const int MaxMessageLength = 2000;
public const int MaxFileSizeBytes = 10 * 1024 * 1024; // 10 MB
public const int MaxAudioFileSizeBytes = 20 * 1024 * 1024; // 20 MB
public const int MaxImageSizeBytes = 10 * 1024 * 1024; // 10 MB
public const int MaxAudioFileSizeBytes = 10 * 1024 * 1024; // 10 MB
public const int MaxFileSizeBytes = 100 * 1024 * 1024; // 100 MB
public const int MaxAvatarSizeBytes = 2 * 1024 * 1024; // 2 MB
public const int MaxMessageNewlines = 30;
public const int MaxConsecutiveNewlines = 1;
+1
View File
@@ -12,6 +12,7 @@ public record MessageDto(
string? AttachmentUrl,
string? AttachmentFileName,
DateTimeOffset SentAt,
long? AttachmentFileSize = null,
List<EmbedDto>? Embeds = null);
public record ChannelDto(
+1
View File
@@ -7,6 +7,7 @@ public class Message
public MessageType Type { get; set; } = MessageType.Text;
public string? AttachmentUrl { get; set; }
public string? AttachmentFileName { get; set; }
public long? AttachmentFileSize { get; set; }
public string? EmbedJson { get; set; }
public DateTimeOffset SentAt { get; set; } = DateTimeOffset.UtcNow;