My method to stop compulsively checking messages yet still be responsive to my clients' support emails was to institute the Pomodoro Method (25 minutes on a task, 5 minutes off, repeat for the whole work day). I close off all communication (Slack, email, Skype, etc) for the 25 on-task minutes and only check them during the 5 minute breaks. If something urgent comes up, I dedicate my next 25-minute task period to dealing with that item.
This has broken me of my involuntary email/Slack/IM checking and instead keeps me focused on the task at hand.