Automatic Role Creation & Assignment
Closed this issue · 1 comments
Summary
The bot will manage who can and cannot speak. It will do this by applying roles to users that represent their current status in-game.
Thus following roles need to be created at game start time:
- Alive, to be applied to users while they are alive
- Dead, to be applied to users while they are dead
- Spectating, to be applied to users while they are spectating.
Users in the call should have their role checked and updated accordingly at the following times in the life-cycle of a game:
- Game started (not created!)
- Player joined the call (only check the user who joined)
- Player left the call (only check the user who left)
- Game ended (remove all roles)
Remarks
This system should be relatively extensible (read: don't assume these are the only roles, but don't break your back trying to simplify the addition of extra roles).
Permission management on the created roles is not in the scope of this issue.
Open Questions
- Should the roles be deleted when a game ends?
- yes, to keep the guild clean when there are no games running
- no, because then they need to be recreated. This can cause undue risk of failure or server load when games are started shortly after another ends
I have decided to delete the roles on game end. This is because deleting the role will automatically remove the role from all users that have it. This helps ensure residual Discord state gets cleaned up at the end of the game.