User's in a group can only chat with that group

So I’m trying to create group chats, where only people on the same group can communicate with each other.

What do I need to do?
Create different channels for all the different groups?
How do I join a user to a certain group? Do I need to add a new column for the users with a group id?

Any help and tips will be really appreciated,
Thank you very much,
Alex.

Hello,

One of the options is to as you mentioned - to create a different channel for each group. Then you can subscribe the users to their groups/channels and they will be able to receive messages only from that groups.

Hey Sergey,

Thanks for answering! Do you know if I can have a infinite number of channels? Or are these limited?

Thank you,
Alex

I’m not aware of any limit for a number of messaging channels. I believe for any reasonable number of users you’ll be able to have as many channels as you need.