I've tried to send a message with @channel, @here and @user, but they are sent as text.
This is the code....
import os
from slack import WebClient
from slack.errors import SlackApiError
client = WebClient(token='xoxb-**************************')
try:
response = client.chat_postMessage(
channel='#prueba',
text="@channel Hello world!",
as_user=False)
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've read both PythonSlackclient Docs and the API Docs, but I don't find an option to broadcast my messages or how to mention someone.
