if it has 3 wires, it's likely a " Hall throttle " .. black= ground.. red = 5v and the 3rd wire ( can be white, yellow, etc ) will vary from 0 to 5v when you twist.. if it got hit , one of the magnets inside may have disloged, it can be taken apart for inspection, do it when the plastic is warm and soft to prevent snapping the legs.. the spring inside is a royal pain to put back together but it's do-able..
do the voltage test first, then proceed with the surgery.