You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# At this point, at a minimum, text argument is missing. Warn the user about this.
258
+
message= (
259
+
f"The top-level `text` argument is missing in the request payload for a {endpoint} call - "
260
+
f"It's a best practice to always provide a `text` argument when posting a message. "
261
+
f"The `text` argument is used in places where content cannot be rendered such as: "
262
+
"system push notifications, assistive technology such as screen readers, etc."
263
+
)
264
+
warnings.warn(message, UserWarning)
265
+
266
+
# Additionally, specifically for attachments, there is a legacy field available at the attachment level called `fallback`
267
+
# Even with a missing text, one can provide a `fallback` per attachment.
268
+
# More details here: https://api.slack.com/reference/messaging/attachments#legacy_fields
246
269
attachments=kwargs.get("attachments")
247
270
# Note that this method does not verify attachments
248
271
# if the value is already serialized as a single str value.
# Check if the fallback field exists for all the attachments
285
+
# Not all attachments have a fallback property; warn about this too!
286
+
message= (
287
+
f"Additionally, the attachment-level `fallback` argument is missing in the request payload for a {endpoint} call"
288
+
f" - To avoid this warning, it is recommended to always provide a top-level `text` argument when posting a"
289
+
f" message. Alternatively you can provide an attachment-level `fallback` argument, though this is now considered"
290
+
f" a legacy field (see https://api.slack.com/reference/messaging/attachments#legacy_fields for more details)."
0 commit comments