Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Slack API search.messages不支持在特定通道中搜索_Python_Slack Api - Fatal编程技术网

Python Slack API search.messages不支持在特定通道中搜索

Python Slack API search.messages不支持在特定通道中搜索,python,slack-api,Python,Slack Api,我正在使用search.messages从特定组和用户名检索消息。 它使用了惰轮模块 代码段: slack = Slacker('token') resp = slack.search.messages(query='test',highlight=1) print resp.body['messages'] 这可以工作,但可以从所有组获取结果 这里的文档显示外接程序:channel\u name、in:group\u name或in:username。要搜索来自特定发言者的消息,请添加发件人

我正在使用search.messages从特定组和用户名检索消息。 它使用了惰轮模块

代码段:

slack = Slacker('token')
resp = slack.search.messages(query='test',highlight=1)
print resp.body['messages']
这可以工作,但可以从所有组获取结果

这里的文档显示外接程序:channel\u name、in:group\u name或in:username。要搜索来自特定发言者的消息,请添加发件人:用户名或发件人:姓名

但是添加这个会导致语法错误

错误消息:

    resp = slack.search.messages(query='test',highlight=1,'in:my_test_channel')
SyntaxError: non-keyword arg after keyword arg

@mgilson已经在评论中得到了回答


resp=slack.search.messagesquery='testin:my_test_channel',highlight=1

什么引发语法错误?我猜您会将其添加到查询中:例如slack.search.messages'in:channel\u name test'在错误消息上方更新