🐛 Fix interaction failures stemming from bot reset / state loss#175
🐛 Fix interaction failures stemming from bot reset / state loss#175
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
==========================================
+ Coverage 59.38% 61.74% +2.36%
==========================================
Files 50 50
Lines 2903 2941 +38
==========================================
+ Hits 1724 1816 +92
+ Misses 1179 1125 -54 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| return | ||
| user_id = ban.user_id | ||
|
|
||
| member = await self.bot.get_member_or_user(interaction.guild, user_id) |
There was a problem hiding this comment.
What if get_member_or_user returns None? Should we try...except here?
There was a problem hiding this comment.
Down to preference I guess. The function itself has a bunch of exception handling to log the various possible errors, but there is no way to really handle/correct for it (beyond the logging), so it may make sense to let the exception bubble up. Whatever you prefer, really
There was a problem hiding this comment.
Could make sense if member is None to return and not even try to unban. Right now, it would seem to the moderators that the member that wasn't found has been unbanned/denied.
There was a problem hiding this comment.
fair point, I will change that
Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that apply.Proposed changes
View interactions would fail if the bot had been reset or lost connection causing some staff actions to result in "This interaction failed" when clicking on buttons in views.
Checklist
Put an
xin the boxes that apply.doc.
Additional context