Tell people when someone joined a session
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Hamcha 2019-06-27 18:15:51 +02:00
parent f8b5dbfc17
commit be83334e3a
1 changed files with 7 additions and 0 deletions

View File

@ -104,6 +104,13 @@ func (d *draftBot) handleMessage(roomid string, msg room.Message) {
// Add player to the list
session.Players[msg.From] = nil
d.sendMessage(roomid, room.Message{
Channel: "draft",
Type: "player-joined-session",
Data: msg.From,
Message: fmt.Sprintf("%s joined the draft session (%d players, %d missing)", msg.From, len(session.Players), len(session.Pod.Players)-len(session.Players)),
})
// Player wants something else
default:
// Tell them can either join or GTFO