Esempio n. 1
0
        async Task newPlayerTryJoin(SocketGuildUser user, TTTGame game)
        {
            if (game.GetPlayer(user) != Position.Empty)
            {
                return;
            }
            if (game.Crosses == null)
            {
                game.Crosses = user;
            }
            else
            {
                game.Naughts = user;
            }
            await game.Message.ModifyAsync(x => x.Embed = game.ToEmbed());

            var role = game.Guild.Roles.FirstOrDefault(x => x.Name == TTTService.RoleName);
            await user.AddRoleAsync(role);

            await game.Message.Channel.SendMessageAsync($"{user.Mention} has joined as {game.GetPlayer(user)}s");
        }