Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/339.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电报发送程序筛选器_Python_Python 3.x_Telegram Bot_Python 3.8_Python Telegram Bot - Fatal编程技术网

python电报发送程序筛选器

python电报发送程序筛选器,python,python-3.x,telegram-bot,python-3.8,python-telegram-bot,Python,Python 3.x,Telegram Bot,Python 3.8,Python Telegram Bot,我想创建一个处理程序,当一个concret用户(@exampleuser)发布一条包含单词列表中的单词的消息时触发它 这就是我所做的: dispatcher.add_handler(MessageHandler(Filters.regex(re.compile(r'*example word from the wordlist*',re.IGNORECASE))和Filters.sender_chat(390077500)),wordBan) 但是如果我只使用:dispatcher.add\u

我想创建一个处理程序,当一个concret用户(@exampleuser)发布一条包含单词列表中的单词的消息时触发它

这就是我所做的:
dispatcher.add_handler(MessageHandler(Filters.regex(re.compile(r'*example word from the wordlist*',re.IGNORECASE))和Filters.sender_chat(390077500)),wordBan)

但是如果我只使用:
dispatcher.add\u handler(MessageHandler(Filters.sender\u chat(*example user id*)),wordBan),它就不起作用了。
它可以工作,但不会在具体用户发送消息时触发,而是在任何用户发送消息时触发

如何添加具体的用户筛选器使用

dispatcher.add_handler(MessageHandler(Filters.regex(re.compile(r'*example word from the wordlist*',re.IGNORECASE))&Filters.sender_chat(390077500)),wordBan)
您希望使用
&
|
组合PTB筛选器