MCPcopy Index your code
hub / github.com/slackapi/python-slack-sdk / message

Function message

integration_tests/samples/issues/issue_506.py:24–32  ·  view source on GitHub ↗
(**payload)

Source from the content-addressed store, hash-verified

22
23@RTMClient.run_on(event="message")
24def message(**payload):
25 data = payload["data"]
26 if data.get("bot_id", None) == global_state["bot_id"]:
27 logger.debug("Skipped as it's me")
28 return
29 # do something here
30 web_client = payload["web_client"]
31 message = web_client.chat_postMessage(channel=data["channel"], text="What's up?")
32 logger.info(f"message: {message['ts']}")
33
34
35rtm_client = RTMClient(token=os.environ["SLACK_API_TOKEN"])

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
debugMethod · 0.45
chat_postMessageMethod · 0.45

Tested by

no test coverage detected