slackapi / slackapi/python-slack-sdk
markdown block type not supported when sending via WebhookClient / response_url
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 4k
- Fork
- 857
- Merge trung bình
- 22 giờ 21 phút
- Pull request đã merge (30 ngày)
- 16
Mô tả
The markdown block type (introduced in Block Kit - Feb 2025, expanded in Mar 2026) works correctly when sent via WebClient.chat_postMessage, but returns a 500 error when sent via WebhookClient (i.e. slash command
response_url).
Reproducible example:
from slack_sdk.webhook import WebhookClient
from slack_sdk import WebClient
blocks = [
{
"type": "markdown",
"text": "## Heading\n\n| Col A | Col B |\n|---|---|\n| 1 | 2 |"
}
]
# ✅ Works — returns 200
client = WebClient(token="xoxb-...")
client.chat_postMessage(channel="#test", blocks=blocks, text="fallback")
# ❌ Fails — returns 500
webhook = WebhookClient("https://hooks.slack.com/commands/T.../...")
webhook.send(blocks=blocks)
Expected behavior: WebhookClient.send() should support the markdown block type, same as chat.postMessage.
Actual behavior: Slack's response_url endpoint returns HTTP 500 with no descriptive error body.
Context:
- slack_sdk version: 3.39.0
- Python version: 3.12.12
- This affects slash command responses where response_url is the standard reply mechanism
Category (place an x in each of the [ ])
- slack_sdk.web.WebClient (sync/async) (Web API client)
- slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
- slack_sdk.models (UI component builders)
- slack_sdk.oauth (OAuth Flow Utilities)
- slack_sdk.socket_mode (Socket Mode client)
- slack_sdk.audit_logs (Audit Logs API client)
- slack_sdk.scim (SCIM API client)
- slack_sdk.rtm (RTM client)
- slack_sdk.signature (Request Signature Verifier)
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với slack_sdk.webhook.WebhookClient.send() và các triển khai đồng bộ/bất đồng bộ của nó, sau đó so sánh cách xử lý block của chúng với WebClient.chat_postMessage(). Chạy ví dụ markdown-block được cung cấp trên cả hai endpoint và kiểm tra hành vi của response. Hoàn thành khi WebhookClient hỗ trợ nhất quán loại block markdown, hoặc khi giới hạn của endpoint được xác định rõ ràng và được các bài kiểm thử bao phủ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 68/100