@@ -433,24 +433,33 @@ def to_dict(self) -> dict: # skipcq: PYL-W0221
433433
434434
435435class BlockAttachment (Attachment ):
436- attributes = {"color" }
437436 blocks : List [Block ]
438437
439- def __init__ (self , * , blocks : Sequence [Block ], color : Optional [str ] = None ):
438+ @property
439+ def attributes (self ):
440+ return super ().attributes .union ({"blocks" , "color" })
441+
442+ def __init__ (
443+ self ,
444+ * ,
445+ blocks : Sequence [Block ],
446+ color : Optional [str ] = None ,
447+ fallback : Optional [str ] = None ,
448+ ):
440449 """
441- A bridge between legacy attachments and blockkit formatting - pass a list of
450+ A bridge between legacy attachments and Block Kit formatting - pass a list of
442451 Block objects directly to this attachment.
443452
444453 https://api.slack.com/reference/messaging/attachments#fields
445454
446455 Args:
447456 blocks: a sequence of Block objects
448-
449457 color: Changes the color of the border on the left side of this
450458 attachment from the default gray. Can either be one of "good" (green),
451459 "warning" (yellow), "danger" (red), or any hex color code (eg. #439FE0)
460+ fallback: fallback text
452461 """
453- super ().__init__ (text = "" , color = color )
462+ super ().__init__ (text = "" , fallback = fallback , color = color )
454463 self .blocks = list (blocks )
455464
456465 @JsonValidator ("fields attribute cannot be populated on BlockAttachment" )
0 commit comments