We've been having some performance issues with infraction creation, especially when banning people who aren't in the guild. In particular, we've been getting 500 errors from the GetBansAsync call that GetUserInformationAsync makes, so I think this PR should eliminate those particular 500s entirely (within the context of infraction creation anyway).
Eliminate expensive GetUserInformationAsync call when the user is not currently in the guild.
Perform fast, easy validations earlier.
Reuse retrieved guild and guild user objects instead of retrieving and tracking multiple times.
We've been having some performance issues with infraction creation, especially when banning people who aren't in the guild. In particular, we've been getting 500 errors from the
GetBansAsync
call thatGetUserInformationAsync
makes, so I think this PR should eliminate those particular 500s entirely (within the context of infraction creation anyway).GetUserInformationAsync
call when the user is not currently in the guild.