[英]How do I get a slack bot that is sending a message via Python to post @here and ping the channel?
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.目前,我的 slack 应用程序/机器人将发布通过 Python 发送的消息,该消息在文本中包含 @here 或 @channel,但不会突出显示 @here 或 @channel,也不会实际 ping 通道。 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输出 = @here 这是一个测试
To use @here & @channel as 'mentions',要将@here和@channel用作“提及”,
they are marked as :它们被标记为:
<!here>
& <!channel>
<!here>
& <!channel>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.