The usage of a map fits the mapping of handlers here.
But in general you don't want to over-engineer 15-line piece of code of if just for the beauty of it, especially if you have business logic in it.
Also, it is not canonical in debugging aspect : each time they need to cold read that code, people will feel the need to check Map.get(...) behavior in docs for non-existent cases, thus adding technical debt for no practical benefits.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The usage of a map fits the mapping of handlers here.
But in general you don't want to over-engineer 15-line piece of code of if just for the beauty of it, especially if you have business logic in it.
Also, it is not canonical in debugging aspect : each time they need to cold read that code, people will feel the need to check Map.get(...) behavior in docs for non-existent cases, thus adding technical debt for no practical benefits.