python - python-telegram-bot:&=不支持的操作数类型:'function'和'_UpdateType'
问题描述
当机器人启动时,python-telegram-bot 库中会弹出一个错误。
File "/usr/local/lib/python3.5/dist-packages/telegram/ext/messagehandler.py", line 131, in __init__
self.filters &= Filters.update
TypeError: unsupported operand type(s) for &=: 'function' and '_UpdateType'
unsupported operand type(s) for &=: 'function' and '_UpdateType'
在 messagehandler.py 中
if message_updates is False and channel_post_updates is False and edited_updates is False:
raise ValueError(
'message_updates, channel_post_updates and edited_updates are all False')
self.filters = filters
if self.filters is not None:
self.filters &= Filters.update
else:
self.filters = Filters.update
解决方案
推荐阅读
- ios - 我正在使用 xlpagertabstrip 。加载视图控制器后,我想定期从父视图控制器向子视图控制器发送一些数据
- node.js - 如何使用 NodeJS 将数据插入到带有自定义字段的 bigquery 表中?
- python-3.x - 张量流错误:尺寸必须相等
- java - API 需要 GET 方法但需要发送参数
- wordpress - 单击结帐按钮时,登录弹出窗口会显示如何禁用此登录表单
- splunk - 使用 Splunk rex 命令提取 2 个单词之间的字段
- codeigniter-3 - 在codeginter中获取空白页
- list - Haskell 嵌套列表理解
- r - 如何将带有NA项目的lapply结果转换为R中的数据框?
- fabricjs - fabricjs 免费绘图敏感