if type in [10,11,12] is using an integer to represent the message type. Making it a string would improve readability.
if type in [10,11,12]
is using an integer to represent the message type. Making it a string would improve readability.