[英]Send a Slack message to a user on a channel using Python
我正在将Slack实时消息传递API与Python结合使用,并希望使用@像@hellobot这样,将消息发送给频道上的用户,创建一个目录test2002。
给定的代码不起作用:
slack_client.api_call("chat.postMessage", channel='#bot',text="create directory test2002",username='ecstesting1989')
如果我使用:
slack_client.api_call("chat.postMessage", channel='#bot',text="@hellobot create directory test2002",username='ecstesting1989')
这将以文本格式将命令作为@hellobot create directory test2002发送,并且不起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.