Rocket Chat is an open source alternative to Slack. It has most of the same features. It's end to end encrypted. You can self host it, but there is no free tier unlike Slack or Discord.