(1) A person commits a class 6 felony, if he:
(a) Solicits, accepts, or agrees to accept any pecuniary benefit as compensation for having, as a public servant, given a decision, opinion, recommendation, or vote favorable to another or for having otherwise exercised a discretion in his favor, whether or not he has in so doing violated his duty; or
(b) Offers, confers, or agrees to confer compensation, acceptance of which is prohibited by this section.