-
Notifications
You must be signed in to change notification settings - Fork 847
Closed
Labels
Version: 3xdocsM-T: Documentation work onlyM-T: Documentation work onlyoauthquestionM-T: User needs support to use the projectM-T: User needs support to use the project
Description
I have the Slack Desktop client installed on my computer.
I want to be able to use the SDK to send messages.
I read the instructions in your README file but according to the simple example:
import os
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
client = WebClient(token=os.environ['SLACK_BOT_TOKEN'])
try:
response = client.chat_postMessage(channel='#random', text="Hello world!")
assert response["message"]["text"] == "Hello world!"
except SlackApiError as e:
# You will get a SlackApiError if "ok" is False
assert e.response["ok"] is False
assert e.response["error"] # str like 'invalid_auth', 'channel_not_found'
print(f"Got an error: {e.response['error']}")
I need to use SLACK_BOT_TOKEN and I don't have it. You wrote that I can read about Tokens and Authentication from this Auth Guide but the link is broken: https://slack.dev/python-slack-sdk/auth.html
I am running on Windows and I am using the Slack Desktop App for Windows and I didn't find the place I can get the token.
Metadata
Metadata
Assignees
Labels
Version: 3xdocsM-T: Documentation work onlyM-T: Documentation work onlyoauthquestionM-T: User needs support to use the projectM-T: User needs support to use the project