I try to use the slack API to send a message to a workspace, I found this piece of code on their docs but I have an issue with the module slack. This is the code I used:
import os
import slack
client = slack.WebClient(token=os.environ['SLACK_API_TOKEN'])
response = client.chat_postMessage(
channel='#viktor',
text="Hello world!")
assert response["ok"]
assert response["message"]["text"] == "Hello world!"
I have put my app token but it does not recognize WebClient
... any idea?