diff --git a/draftbot/draftbot.go b/draftbot/draftbot.go index 52f6378..8edb342 100644 --- a/draftbot/draftbot.go +++ b/draftbot/draftbot.go @@ -112,6 +112,22 @@ func (d *DraftBot) handleEvent(roomid string, evt room.Event) { Owner: evt.Room.Creator, } + // Someone left + case room.EvtLeft: + // Check if room has a running session + sess, ok := d.Sessions[roomid] + if !ok { + break + } + // Check if player is in that session + player, ok := sess.Players[evt.PlayerName] + if !ok { + break + } + // Replace player with bot + //TODO + _ = player + // A room got closed case room.EvtRoomClosed: // Check if there's a session there