MODiX
MODiX copied to clipboard
Show special error message when a user tries to look up info or infractions for a deleted user
Discord's deleted user placeholder Deleted User#0000
uses ID 456226577798135808
. When an account is deleted, the sender for the messages is replaced with the placeholder. Normally we wouldn't be able to perform a lookup on such a user, but we can reference join and leave logs, which do record the ID of the actual account.
If we're trying to perform an infraction search on a deleted account, having a warning that we're searching on the placeholder instead of the real account would be nice to avoid some confusion like I just had.
This is still relevant, the command simply errors out with an invalid user ID. Responding with an notice that the ID is that of a ghost user would be useful.
I think that "A specified user ID is invalid" error message is from Discord itself, not the bot. In theory, I think we could create a custom type for our parameters instead of IUser and use a custom type converter, but I'm not sure if it's really worth the effort.
I didn't think to include a screenshot at the time, but here's the incident I was referring to originally.
Since we're tying into the bot command infrastructure, I don't know if the difficulty of catching this case has changed. I'm not really familiar with how it works. I thought it would just be a if (id == 456226577798135808)
check.
No longer relevant, command does not work