One common option I've seen in companies I've worked in was to have multiple Slack Channelschannels, one for work, and one for general chat.
You You can then enforce a strict nohello policy on the work channel on the understanding that the general-chat channel may not receive priority response.
This can be explained in the header for the channel as a rule, and therefore not be considered rudeness.
You can enforce it with a slackbotSlack bot scanning for keywords and short messages as other Answersanswers here have suggested.