I mean, the same way we deal with corruption, bribery, and threats generally; have a strong, independent law enforcement and prosecutors office. The FBI regularly and successfully investigates (and the DoJ indicts and secures convictions for) legislators, whose voting record is already public, who sell their votes on city councils or in state legislatures. It takes a lot of votes to swing most elections, so a concerted bribery campaign would be much easier to investigate than these examples.