PiGPIO need help

Hello.I need some help writing some code.I am receiving pulses in my Rarpberry Pi pin and want to write some code to count pulses and print a message "button was pressed " at each pulse.Any ideas?