From cd24ab9c18680819fe7c42592df566c82dbca073 Mon Sep 17 00:00:00 2001 From: Abitofevrything Date: Sat, 16 Sep 2023 15:27:19 +0200 Subject: [PATCH] Make filename required in AttachmentBuilder --- 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, }; }