fix: weekly update reminder#31
Conversation
🛡️ PR Quality Check Summary✅ PR Title: Passed (Length: 27/75, Format: OK). 🎉 All checks passed! |
There was a problem hiding this comment.
Pull request overview
This PR fixes the weekly update reminder functionality by enabling the Members Intent, which was causing role.members to return an empty list. The PR also introduces logging with the rich library for better readability.
Changes:
- Enabled Members Intent in bot.py to allow accessing guild member information
- Replaced print statements with structured logging using Python's logging module and RichHandler from the rich library
- Added debug logging to track message checking and member verification
- Added error checks for empty role members to aid debugging
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| bot.py | Enabled Members Intent by setting intents.members = True to fix the empty role.members issue |
| cogs/weekly_update_reminder.py | Added logging configuration with RichHandler, replaced isinstance check, added debug logging and error checks for troubleshooting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wade00754
left a comment
There was a problem hiding this comment.
Thanks for the log feature!
目的
因為我們忘記開啟intent,所以導致
role.members拿到的是一個empty list,所以追殺熊沒有正常運作方法/實作說明
解決方法就是把設定頁開啟

Members Intent,並且在bot.py裡面設定好intent即可discord-bot/bot.py
Line 10 in fdb6f5b
在這裡也一併先把 print 改成 logger,並且配合 rich 的 RichHandler 來讓 logging 更好讀一些
關聯 Issue
Close #29
附註
請 @wade00754 先 review 這支,我等這支被 merge 進 main 之後我會再 rebase #32 ,到時候再麻煩你幫我 review 那邊的了