环境说明 Telegram界面设置群组的默认权限. 进群验证机器人 (tg-join-group-exam-bot.py) 在新成员通过验证后, 会在 Exceptions 里面设置权限. 清除 Exceptions 工具 (tg-clean-exceptions.py) 会读取群组的默认权限, 再读取 Exceptions 中某个用户的权限. 测试过程 Case 1. 群组默认权限 music - Close voice messages - Close tg-join-group-exam-bot.py 设置 permission can_send_audios=False, can_send_voice_notes=False, 新成员通过验证后, 在Exceptions中的记录是这样的, 符合期望 tg-clean-exceptions.py default_rights = entity.default_banned_rights 读出来的是什么 rights = getattr(p.participant, 'banned_rights', None) 读出来的是什么 可以看到默认权限是对的. 这个属性是 default_banned_rights. 所以 Ture 表示 Close. 而读取的 Exceptions 里面, 用户的权限是 错的 . False 表示 Open. Case 2. 群组默认权限 music - Close voice messages - Close tg-join-group-exam-bot.py 设置 permission can_send_audios=True, (意思是 Open) can_send_voice_notes=True, (意思是 Open) 新成员通过验证后, 在Exceptions中的记录是这样的, 不符合预期 . 因为上面的代码中设定的 permission 是 True, 应该是有这两个权限的. 而 telegram 界面上显示是没有. tg-clean-exception...