[英]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.