How can I manually delete a room after a set time?

Is it possible to delete the room manually? I need room and I need to chat in the room persistent but after some minute (for example one hour) I want to remove that room.
I can’t find any solution to remove the room.

Thanks for your help in advance.

Hi @morteza welcome :wave:

Is it possible to delete the room manually?

A chat channel in Nakama server only exists as long as members are connected to it on the same stream (Streams are an internal concept of the server used to group online users for pub/sub messages - you can read more about streams here.). There’s really no need to “delete” the channel because when all users disconnect then the channel is gone.

It sounds like you might have some game design linked to how players can send messages to each other within the hour that they’re allowed as part of the chat channel. It’s possible that this would be better represented as a match handler in Nakama. You could implement a simple authoritative match handler that tracks how long it’s alive for and is used to relay messages to all users connected to it. That way you could have the match handler itself authoritatively kick all users from it (just have the match handler stop itself) after the hour has gone.

Let me know if this would handle your use case. Alternatively let me know more about the intent behind the limit of one hour that you want players to have when they’re in chat channels.

Thank you.

I want to design spectate features in my game. My game is a card game and it is turn-base and I’ve developed it based on command pattern. because of that, I can send game commands by message.

for this purpose, one of the ways that I found is to use the room. for example, 4 players are playing together and the host player makes the room for it. other players in the game can join the room as a spectator and get messages and show the game. some players may join the match with delays because of that, the host sends game commands persistently. so the spectators can get the history of room chat and follow the game from start to that moment.