Skip to content

Commit 1254a6c

Browse files
committed
fix MessageUpdateBuilder.RetainAttachments not removing all attachments when not proving any params
1 parent c13ef9f commit 1254a6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/message_update_builder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func (b *MessageUpdateBuilder) RemoveFile(i int) *MessageUpdateBuilder {
177177
// RetainAttachments removes all Attachment(s) from this Message except the ones provided
178178
func (b *MessageUpdateBuilder) RetainAttachments(attachments ...Attachment) *MessageUpdateBuilder {
179179
if b.Attachments == nil {
180-
b.Attachments = new([]AttachmentUpdate)
180+
b.Attachments = &[]AttachmentUpdate{}
181181
}
182182
for _, attachment := range attachments {
183183
*b.Attachments = append(*b.Attachments, AttachmentKeep{ID: attachment.ID})
@@ -188,7 +188,7 @@ func (b *MessageUpdateBuilder) RetainAttachments(attachments ...Attachment) *Mes
188188
// RetainAttachmentsByID removes all Attachment(s) from this Message except the ones provided
189189
func (b *MessageUpdateBuilder) RetainAttachmentsByID(attachmentIDs ...snowflake.ID) *MessageUpdateBuilder {
190190
if b.Attachments == nil {
191-
b.Attachments = new([]AttachmentUpdate)
191+
b.Attachments = &[]AttachmentUpdate{}
192192
}
193193
for _, attachmentID := range attachmentIDs {
194194
*b.Attachments = append(*b.Attachments, AttachmentKeep{ID: attachmentID})

0 commit comments

Comments
 (0)