Currently my slack app / bot will post a message being sent via Python that has @here or @channel in the text but the @here or @channel won't be highlighted or actually ping the channel. Here is the code:
import slack
def slack_notif(slackchannel,message):
client = slack.WebClient(token='xxxmytokenxxx')
client.chat_postMessage(channel=slackchannel, text=message)
slack_notif(
slackchannel = 'mychannel',
message = '<@here> This is a test'
)
Output = @here This is a test
To use @here & @channel as 'mentions',
they are marked as :
<!here>
& <!channel>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.