slackapi / slackapi/python-slack-sdk

markdown block type not supported when sending via WebhookClient / response_url

Aperta
#1,847 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

auto-triage-skip bug server-side-issue
Lingua principale
Python
Stelle
4k
Fork
857
Merge medio
22h 21m
PR unite (30g)
16

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da slack_sdk.webhook.WebhookClient.send() e dalle sue implementazioni sincrona/asincrona, quindi confronta la gestione dei blocchi con quella di WebClient.chat_postMessage(). Esegui l’esempio markdown-block fornito su entrambi gli endpoint e analizza il comportamento delle risposte. Il lavoro è completato quando WebhookClient supporta in modo coerente il tipo di blocco markdown, oppure quando la limitazione dell’endpoint è chiaramente identificata e coperta dai test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Specificata chiaramente
Idoneità per principianti
68/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.