如何批量更新用户的类别通知级别?

我确实需要。\n\npython\n\n category_notifications = {'muted_category_ids': [54],\n 'regular_category_ids': [],\n 'tracked_category_ids': [],\n 'watched_category_ids': [],\n 'watched_first_post_category_ids': [61],\n }\n\t\n api(config, f\"u/{username}.json\", method='put',\n json=category_notifications)\n\n\n\n…其中 api() 是 Requests Python 模块的一个简单封装,它只会在你的 Discourse 站点上对 /u/whateverusernameyouarechanging.json 执行 HTTP PUT 操作,而载荷就是你想要更改的类别。(你可以跳过任何不想更改的类别。)\n\n请注意,你需要的是数字类别 ID——名称无效。当然,如果你想合并或保留已有的内容,你必须先读取用户。