From bfbe4e5dfa19f44083ef29e9bf4d1a5ca674eb06 Mon Sep 17 00:00:00 2001 From: Abitofevrything <54505189+abitofevrything@users.noreply.github.com> Date: Sat, 16 Sep 2023 06:41:51 -0700 Subject: [PATCH] Make filename required in AttachmentBuilder (#546) --- lib/src/builders/message/attachment.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/builders/message/attachment.dart b/lib/src/builders/message/attachment.dart index 45be187c2..07be6241e 100644 --- a/lib/src/builders/message/attachment.dart +++ b/lib/src/builders/message/attachment.dart @@ -8,11 +8,11 @@ import 'package:nyxx/src/models/message/attachment.dart'; class AttachmentBuilder extends Builder { List data; - String? fileName; + String fileName; String? description; - AttachmentBuilder({required this.data, this.fileName, this.description}); + AttachmentBuilder({required this.data, required this.fileName, this.description}); static Future fromFile(File file, {String? description}) async { final data = await file.readAsBytes(); @@ -26,7 +26,7 @@ class AttachmentBuilder extends Builder { @override Map build() => { - if (fileName != null) 'filename': fileName, + 'filename': fileName, if (description != null) 'description': description, }; }