Thank you for your 26 years of service. Career programmers like you who still love programming at the end of it are a treasure. Programming is wonderful. It is an art in itself. Even though Slack and Leetcode and all the rest ruin it, there is nothing else which sparks joy and a sense of wonder like it does for some of us. I wish in our industry we had more wider appreciation and events where we could share stories like you and felicitate you.
In the olden days it was IRC. Already then it was about controlling yourself. Whether you would get distracted or not. If you want to get into the zone, it's up to you how to do that. If you have an IRC or Slack window on the side to let you get distracted is your call.
Were you using IRC as your corporate messaging solution, because that's what slack is? İf people send you a message they expect a timely if not instant response. Their work depends on you.